It can, but be prepared for it to be a pain in the @$$ to fix the repair chain. The original phone will be deactivated from a support/AppleCare+ perspective and the replacement serial will take its place.
“Theoretically” that all gets undone if you return the new phone but in practice, often it’s not done properly and you’ll have to make some phone calls.