You can apply. Some jobs will specifically state onlyCanadian citizen or PR can apply especially if security clearances are involved. Also at the end of each posting will be a statement that Canadians have first priority.
As above , and some Government jobs require an extensive background search that can literally take MONTHS, some up to a year . If you’re from a non Five Eyes country , expect a lengthy delay