Hi if your iphone is locked to some other network provider ..Then just by unlocking the iphone from that provider your friend can freely use it with t-mobile sim ..You can easily unlock your iphone from network lock with the help of providers like Onlinegsmunlock.com here they unlock your iphone using remote unlocking service for affordable cost ..After unlocking your iphone you can freely use it with any GSM sim ....