Yes - in theory this works fine.
I have a 7 speed cassette on some clincher wheels for my `80s race bike for training and commuting, and for events I have a 7 speed freewheel on a mavic hub with tubulars. Swapping wheels is simple.
I have friction shifters so there is no indexing to worry about, but I have to move the lever to slightly different positions. Your bike will need tweaking of the rear gear's indexing at wheel swaps. Once you get it dialed in, simply count the number of turns of the barrel adjuster and this should be a quicker change.
Another gotcha is that your big cogs are likely to be different sizes, so the chain's length will have to be long enough to accommodate the biggest cog. This may limit the choice in big cogs to be "close"
Your brake pads will also need checking for alignment - subtle differences could catch you out. Both Disk brakes and Rim brakes would have similar issues with fine adjustment here.
Lastly, remember this will effectively wear your rear cogs less, and the chain slightly faster. Some people keep a chain with their wheels too, and rethread it when changing wheels, simply to keep the chain and cogs wearing together. Frankly I can't be bothered with that, and simply track my chain's wear closely, changing it before wear becomes an issue.
Vince wearing clinchers and cassette, with tubulars and freewheel separate.