What happens if I can't pay my AT&T Bill?

Can i unlock the iphone 5 b4 i don't pay and use it on another carrier like tmobile? Like b4 the phone gets bad imei for unpaid bill. I know you can't unlock them with a bad imei so i would do it b4.
i'm in the US

Sounds like you don't want to pay your bill at all. If you can't pay why do you want to go to T-Mobile.
Pay your Bill. So you don't have bad credit. If it's a dispute call them up.