In the US, carriers have to unlock your phone once you've paid it off. But a recent Canadian ruling goes one step further: upon request, your device must be unlocked, for free, regardless of contract state. Furthermore, all new phones must be sold unlocked starting in December.
https://www.notebookcheck.net/Canada-will-soon-require-all-smartphones-to-be-sold-unlocked.228166.0.html