Is it illegal to not carry ID in Canada?

No. There are generally no requirements in Canada to carry ID, unless, for example you are driving and are required to carry a valid driver’s license.