A) HOW IT WORKS
Usually a single code from the manufacturer is needed to unlock HTC device. Usually there is only one code available in the database which is updated regularly. If no code is found it might be because a device is not locked or the code is not in the database. It is possible to retry it in a few days/weeks or check another database which is done automatically.
Since 2015 T-Mobile and Metro PCS USA sell devices with preinstalled Device Unlock Application.
Devices with this application needs to be unlock by special service, they can’t be unlocked by any unlock code.
b) HOW TO USE THE CODE
Power on the device with an unsupported (not from original network) SIM and enter the code once prompted for it (usually SIM network unlock PIN)
Note: Make sure the PIN of the SIM card is entered first if requested.