If the device is transferred from a friend to you, the original owner must deregister the device from the original owner's inventory (organization).
If it is not treated as stolen, the license can be purchased from the distributor.
In my experience, I once bought a used device to try, but it was still registered in the original owner's inventory.
That device is a paperweight.
Incidentally, I tried to buy a license by contacting a distributor where personal purchase is available.
Please be careful not to get into trouble.