As far as I know, yes for Android phones. It's a code from the manufacturer specifically for your phone (per the IMEI). Once unlocked, they are permanently unlocked. I've never had any issues after unlocking any android phones.
iPhone's are a different story though since the phone is unlocked by submitting the IMEI phone information to Apples server. There are some temporary iPhone unlocks where you're phone can and will re-lock and then there are permanent iPhone unlocks. Going through your carrier for iPhone's will always be the safest bet. If not an option, buy from a reputable seller/business.
Current Cell Plan
Rogers: 100GB CAN/USA Infinite 2022 BF Deal ($55 + tax)