If you have insurance on your line then you switch to a phone bought off the internet then you should be ok.
It really depends on the company, and I cant speak for TMO, but with Sprint-Nextel doesnt matter where you got the phone, as long as you already have insurance on your line then you are good to go. If you dont have insurance and want to add it with sprint-Nextel you cannot if it more than 30 days of activation, and I mean new activation, not swapping phones.