Hypothetically, it will work.
In practice, it depends on whether or not AT&T mucked with the firmware to do a "check" to see if hotspot was available. I know in the handful-of-years past when hotspot / tethering was new, carriers had a flag on peoples accounts to see if they could utilize the feature and bake it in the firmware to check for this flag, meaning this feature would be broken if changing carriers. I haven't heard complaints about this with BYOD in recent years, so I don't know if its because people don't use hotspot with BYOD from another carrier or if it's they stopped using that flag.
If you know someone with T-Mobile, you can see if you can borrow their SIM in your phone for a minute to see if it works.
Manage your T-Mobile account