*Now if you want to port out and move to a CDMA carrier you'll have to buy a new phone if you start from T-Mobile.
FTFY.
Buying a T-Mobile labelled iPhone will work fine on AT&T.
Sprint is still very picky even with their supposed BYOD program so even if it supported Sprint, they would almost certainly force you to buy an iPhone from them.
It would *technically* work on Verizon too, but you would not be able to access their 3G EV-DO or 1X legacy networks. You would only be able to access their LTE network (which is on Bands 2, 4, and 13 - all iPhones support these bands) and you could still make phone calls just fine thanks to VoLTE.
But they likely wouldn't activate it, and there are still areas, almost eight years later, that still are 3G only on Verizon.
Have you tried using a TMobile iPhone 7 on Verizon's LTE network?
I asked about this previously and was told that it doesn't work at all.
https://forums.macrumors.com/thread...-7-7-plus-thread.1998028/page-3#post-23616765