An AT&T SIM card may be used in a T-Mobile phone if the phone is unlocked. SIM cards may be used in phones from different companies if the SIM card slot is the same size and if the phone is unlocked.
Most cell phones and smart phones have certain software restrictions that keep the device tied to a certain network. If the device uses a SIM card, these restrictions can be removed by unlocking it, this will allow the card to be used on whatever network the user desires. Unlocking a smart phone may also allow access to other features, such as access to background programs and use of unauthorized apps.
Certain phone companies offer unlocking services for customers in good standing. Alternatively, instructions on how to unlock a cell phone may be found online through a web search of the model of the device.