No, it's not "illegal" per se, but you must not stay in Canada longer than you're authorized to. If you could provide more information on the specifics of where you're coming from, how long your PR ap has been in process, and if you filed inland or outland, we can give you more information on how to maintain your temporary status while you wait.