Yes. But in all likelihood the tmobile phone is equipped with a SIM lock, which is a technological measure that prevents the phone from communicating with any SIM card unless the card identifies itself as belonging to the same network that originally sold the phone.
If you've unlocked your tmobile phone, then unless it's an extremely old model (incompatible with recent SIM card specs), it certainly will work with an AT&T SIM card. If the tmobile phone happens to be a 3G model, and it attempts to communicate using tmobile's 3G implementation, then it will be restricted to 2G while operating on AT&T's network due to incompatible frequencies.