To me, it is a clear cut *real-world* distinction between moving into a city and moving into an HOA gated (or not) community, from a real-world libertarian perspective.
First case: You buy property with conditions set by the previous line of ownership, you agree to the conditions. Second case: The fact that you can move to another legal jurisdiction (city, municipality, etc) is totally different. For example, you buy a property from previous owners, yes, and you know it is in Smithville, and Smithville has X-percent taxes. If it is the same situation as across the States and most of the world today, you make your agreement to purchase with the current ownership for so-and-so price.
The difference is that in the second case, you made no agreement whatsoever to the conditions imposed. The fact that you can choose to live in a lower-tax jurisdiction motivates many moves but does not legitimize the theft at all.
Add to that the fact that the city of Smithville, or its council, or its mayor, or its king, had arrogated itself the power to steal some sum from the residents or home owners in its turf.
Any such “government” can also change the rules whether you agree or not.
So on principle, it is indeed clear. What you agree to in an exchange is legitimate. A monopoly-group of force that decides what its duties are and how much to extort in its designated territory is NOT legitimate.
Moving into conquered territory for whatever reason does not make the victorious conquerors any more legitimate.