Yes, in most major markets. In the US, the Unlocking Consumer Choice and Wireless Competition Act (2014) made it legal to unlock your phone once your contract or installment plan is paid off. The EU also supports carrier unlocking. Always check your local laws, but for most readers: legal, as long as you own the device or have paid it off.
Keep in mind that unlocking your phone's bootloader may void your warranty and could potentially brick your device if done incorrectly. unlock a cell phone
To enable Developer Options on an Android phone: Yes, in most major markets
Unlock Your Cell Phone: Why You Should, How to Do It, and What to Watch Out For Always check your local laws, but for most
The process of unlocking a cell phone varies depending on the carrier, phone model, and operating system. Here are the general steps: