I have a bunch of different cassettes, on different wheels, and for different terrain.
It's not a problem swapping them out, as long as you replace your chain at appropriate intervals.
It only becomes a problem if you allow the chain to stretch, and wear down your cassette. In that circumstance, the old chain and old cassette may run ok, but a new cassette won't with the old chain.
But if your chain is stretched that much, you need to get rid of the chain, or you'll just be destroying your new cassette.
As for the chain length, size it to fit the largest cog. The RD should have enough chain wrapping capacity to deal with the smaller cassette.
__________________
You could fall off a cliff and die.
You could get lost and die.
You could hit a tree and die.
OR YOU COULD STAY HOME AND FALL OFF THE COUCH AND DIE.