There are absolutely no risks in unlocking a device. Unlocking basically means allowing your phone to operate with other network service providers as well. If you chose the above two methods to unlock your phone there are not going to be any issues with it.
Beware of the fraudulent and shortcut methods for unlocking your phone that is present on the internet. Even though it is not an inherently problematic exercise, you might still get into trouble for using these unsolicited methods.
Also, to avoid further issues make sure you are using a reliable third-party service for getting the unlocking code if you chose to go with that method.