In theory, it should. Just remember that any remaining balance on a device payment plan will be billed directly to your final statement. It is possible that some features may not work unless you flash the new carrier’s firmware.
5G access would be a big “maybe” and no guarantee. 5G technology/standards are different among each of the carriers and there is no universal standard yet.
Just another day in paradise…..