Unlock codes are cell phone specific. They are based on the IMEI and not a general code for a model. Every phone that is made has a corresponding unlock code from the manufacture. If you are a customer in good standing on Tmobile for at least 3 months, call tech support and they will usually provide you with the code free of charge. If not you can use a 3rd party to get one. I used cellcorner.com and they were okay, took them 2.5 days.
Don't enter too many bad unlock codes or it will render the phone useless!