Yes, for the most part. In the past, devices like the iPhone were automatically locked to a carrier for good, as these carriers feared you’d buy it and move on to another company. Nowadays, however, most major carriers will let you unlock a phone after purchase, with some, like Verizon, forcing you to wait 60 days and others, like AT&T, forcing you to meet certain criteria, like being a customer in good standing. Note, that if you’re still “paying off” your device (i.e. you’re paying for your phone in installments) or it’s not purchased outright, a carrier won’t unlock it.