Unlock codes are completely safe for your Microsoft Lumia.
You should be 100% sure of your phone network and country. In case of wrong network provided, you run the risk of reciving wrong code.
You also need to be sure that your IMEI number is given correctly.