Yes, people have been unlocking phones but without the carrier's consent you have to 'jailbreak' the phone. I'm going to assume that the phone either needs to be out of contract or you need to pay the balance due on the phone to get it unlocked.
If providers are going to have to unlock phones then I can see them changing things up a bit. Instead of the phone company 'subsidizing' your phone which you are allowed to keep when your contract is up, I see plans that include a lease fee for the phone with a new phone every years (or two) option if you turn in your old phone. With this model, just like car leasing if the phone is beat up or doesn't include all the accessories you'll be charged a 'lease disposition' fee. Providers will keep their user base locked in and won't have to provide unlock codes because the phone remains the property of the provider. If the user wants to unlock the phone they will need to pay the lease buyout fee and the phone will be theirs.