It’s possible by having the webfinger endpoints at the “root” while keeping the rest of Lemmy on a subdomain. The main thing that determines the domain in your username is webfinger.
No clue if Lemmy or kbin support this config though, but quite a bit of the microblog-only parts of fedi do, and it’s a widely used thing.
There are signing keys involved, so if someone puts up a new server but uses different keys then all sorts of federation trouble will await them.
That said it shouldn’t affect the general network, just that individual server (both the communities and the users of it)
Edit: As for switching domains on an existing server, that would be equally troublesome as ActivityPub kinda relies on domains for all sorts of IDs.