In the US, almost all phones sold are carrier locked. That means you can only use the phone with the carrier you purchased it from. If it's an AT&T phone, you cannot use it with T-mobile and vice versa. Verizon and Sprint use different encoding methods, so their phones are completely incompatible with AT&T even if they were unlocked.
For iPhone, it's a bit more complicated because it has a lot of other uses besides just making phone calls. If you can get it activated, all you have to do is get your hands on an AT&T microSIM, then you can use the iPhone as basically an iPod on steroids.
That sounds complicated, especially a microSIM. Therefore, I cannot just buy it, ignore having the phone work and using it for music.
Thanks for the clarification. Much appreciated.