I've threaded a few barrels with receivers attached. I actually prefer to not have to remove the barrel from the action. It can be done.
1st choice if barrel is long enough, slide the barrel through the headstock and center it using a dial indicator and the 4 way chuck on the muzzle end and a spider on the breech end. I think my lathe can do this for 24" or longer barrels. Some lathes have shorter headstocks and can use this method for shorter barrels.
2nd choice, if barrel isn't long enough, creatively and carefully clamp 4 jaw chuck onto receiver. Use stead rest and/or live center to support the muzzle end for threading. Also use dial indicator to center it.
3rd choice, if possible, press barrel out of receiver, thread it, and then press it back in.