It's not mandatory but it depends upon the program. For many PNPs, a degree in that province is either a requirement or gives you many more points than not having one.
The federal programs do not require Canadian education but do give points for it, as well. (And, moreover, require foreign education with ECAs, and sometimes those ECAs can underrate foreign credentials.)