Getting locked outside your iPhone is not the most absurd thing that can ever happen. In fact, it happens quite a lot to people using an iPhone, especially when they have bought a second hand one.
Unlocking an iPhone is totally legal in ever country, however laws can always change. This is why you should stay updated about any changes your government makes. If you have still not paid off for your phone completely, then the original carrier still has ownership over it. In such a case, your carrier may not want you to unlock the phone, so that you do not go to another carrier without paying them off.
If the iPhone has been bought second hand, then it is hard to know whether the phone is locked or not. So, the easiest way to find out is by popping in a SIM card of another network. If the phone is locked, then it will not work on another network. However, if it works, that means the phone is not blacklisted or locked.
If you find out that your phone is blacklisted or locked, then you can take the help of professionals that provide this service. You will find many options online. For more details, click on this link https://canadaunlocking.com/unlock-iphone.
Rather than contacting the original owner to unlock it, you should use an unlocking service. These service providers guarantee a full refund if they fail to unlock your device and usually have a high satisfaction rate. With their assistance, you can be free from the grasp of your carrier. These service providers have strict customer privacy policies, so your information will be safe with them. All you have to do is give them information about the original carrier and the network you want to unlock.