Unlocking is legal in the US (Unlocking Consumer Choice Act) and many other countries, but you must own the device or have permission from the owner.