In the US (DMCA exemption for routers/hotspots since 2021), EU, and most of Asia: Yes . In Canada, it’s legal as of CRTC 2017 ruling. Always check local laws.
For devices that do not prompt for an unlock code, a firmware update or "flashing" tool is used to overwrite the provider-locked software. Zte Mf927u Unlock Tool -UPD-
Automatically identifies the COM port and device version. In the US (DMCA exemption for routers/hotspots since