No you can't use your friends phone with your t-mobile sim until you unlock it from AT&T network provider ...You can easily unlock the phone using network unlock code ...You can purchase code from online providers like TheUnlockArena.com for reliable cost ....You first check that whether the code is available for your mobile model ,country and network provider .If yes then pay for it and unlock the phone then freely use it with any GSM sim ...