I can come up with some hypothetical examples where it could still be an illegal capital move (for instance, they have 2 cities left in the realm, one in the middle of their realm, the other near the front line, and they move it to the less central one for the recruitment benefit); however, in general, I think that realms whose capital has been lost should get at least a little extra leeway in these things.
So if a realm loses its capital to glacier/monsters, does it
have to choose a city away from the frontlines as the new capital as long as there is one available?