Possibly not. Branded phones are often "SIM locked", this means that only a SIM from the provider that sold the device will work until the device is unlocked. In order to do that the device needs to meet the carrier's requirements for unlocking.
Here are T-Mobile's requirements -
https://support.t-mobile.com/docs/DOC-1588
If you need additional help or have more questions or details to share, please join the site so you can reply in this thread. See
this link for instructions on how to join Android Central.