Yes, it does -- with any GSM provider, but AT&T wants to keep you locked in; they paid for a 5 year exclusive (don't take my word for it, google away).
I'm about to *finally* dump T-Mobile, when I told them I was doing it because I have an iPhone, they told me (and I quote), "No problem moving it over here" and I was immediately put in-touch with a 3rd-tier support guy, who told me he helps customers do this all the time, just walking them through installing an application -- Cydia. Yes, Cydia. TMobile is going to walk me through Jailbreaking my iPhone. I stopped him and said, "it's not TMobile's App" he said, "yes." I said, "I'll bet you can't even use the word "Jailbreak" -- he said "that is also correct." I wonder if AT&T knows their competition is helping steal users by violating the manufacturer's warranty (-- rhetorical). FWIW, the claim is you keep Edge and WiFi connectivity, but loose 3G access when you move to TMobile, and that's not Apple's doing either, TMobile doesn't support AT&T's 3G frequency. Yes, another nasty hardware thing, those evil Hardware guys, designing hardware specific to it's purpose and business model. Thank God Microsoft isn't in charge of any phone hardware (also rhetorical, also sincere -- can you say "feb29th bug", and even a bit sarcastic with no intent to offend any specific parties).