A nation’s lawmaking authority comes from the power to govern. Either from a monarchy or a constitution.
When you cross the border into another country you enter an independent nation with its own laws and legal processes.
It is quite possible for you to break a law in another country unintentionally because some nations laws are quite different.
Canadian law does not protect you when you travel outside of the country. There is not much Canada can do to help you.
Always check travel advisories before leaving the country:
https://travel.gc.ca/travelling/advisories