Usually, you know one thing that every smartphone like Samsung, Htc, Huawei, Nokia, is unlocked by unlock code. But iPhone unlocking is little bit different from others. Whether your iPhone is locked or unlocked, this information will be stored in Apple servers. They have all the information about your iPhone. You can use imei to check it.
Brand new iPhone unlockingBrand new iPhones are easy to unlock and less risky. Most of the iPhones will already be unlocked and ready to use it with any carrier if you buy it for full payment. Then If you buy it for monthly installment from a carrier like Dialog, AT&T, Tenor, Netcom.
You cannot use with another carrier so you need to unlock your iPhone to make use of it. If your contract period is over with good account standing then you can request your carrier to unlock your iPhone for free. Or your iPhone contract is not expired with good account standing then you can unlock it with any iPhone unlocking company for some amount.