There's an interesting comparison between the two. Generally people living under governments have little choice; we are ruled whether we like it or not. The most vital difference is in the joining; to enter a club is a voluntary act, taken after considering the costs and benefits without any coercion. To enter a country, however, one needs only to be born in it, which is an action entirely beyond the person's control. In effect he is forced to join. A further difference lies in the cost of leaving; to leave a club or church or voluntary association can be done, for a cost which is generally low and often, zero. But the two also have a strong similarity: rules apply, and if the rules are broken, sanctions are levied. Club members are subject to the club's rules.
Another important difference: governments (states, cities...) are fictional, one reason for which is that the ruling entity has no list of responsible members. A state exists only in the imagination of those affected. A club, on the other hand, does have a list of responsible members, just as a business company has share holding owners. So it would not be correct to call a voluntary association a fiction; it is real. And yet it's a miniature government! How can we resolve this paradox?
Let's do so by imagining a free society, from which all trace of regular government has properly disappeared. Now a builder constructs 50 houses on a lot of land he owns, and offers them for sale at attractive prices. But there's a catch: he has a bias in favor of people with white skin, and knows that there are others who share his prejudice. So he writes a contract specifying that only Caucasians may purchase his houses, and may subsequently sell them only with the same restriction. Administration of this provision is to be entrusted to a Home Owners' Association, to which all purchasers must belong, and this HOA can make other rules for members by majority vote. The homes are all sold, the HOA functions. It decides to collect 5 silver ounces per year per member for expenses, and later chooses to forbid the painting of houses in any color other than gray or brown.
This club has the form of a government, yet its members are real and its basis is that of voluntary association.
What happens when a member falls in love with a girl from India who likes white houses? - he's out of luck. He will be forbidden to keep the home. He can stay and have a white wife and a brown house, but if he wants a white house and a brown wife, he must relocate. Government at work, but in a voluntary club. The couple faces a substantial cost; they may sell the house for a fair price but they must leave all their friends and pay several gold ounces to the removers.
The reader can imagine a whole range of other possibilities, including religious associations - one of which, today, actually forbids members to leave under pain of death! Government at work, but with the form of a voluntary association.
A free society cannot prevent people exercising their freedom in ways that they may later regret, and which most others despise. Such responsibility is all part of what freedom is about. The resolution of problems like the foregoing is that if some club member no longer likes the rules under which he agreed to live, he can quit; and of course nobody will owe any duty to any association with which he has not freely entered a membership contract. The case of an HOA member is unusual in that the cost of quitting is rather high; a big upheaval is needed. That's a cost that must be counted, when membership is first considered; and that in turn suggests that while such anomalies might occur in a free society, they would not occur often. The case of a religious adherent who wants to quit also involves upheaval, loss of friends etc., but nobody outside the church would be involved unless the religious rulers forbid the exit; for then, and then alone, they would be applying force to someone who is, or who wishes to be, a non-member. If that were to happen, the victim would apply to a free-market court to have the force removed, and obtain compensation for the hassle.
A last point: cannot the same reasoning apply today to the resident of a country, who is dissatisfied with its government? Cannot he just emigrate and live in one more to his liking? - and is not that an argument for leaving governments in place? I did this myself once, so the question is close to home. And there are many Americans today who are so disgusted with the monstrous way government here is developing that they are seriously considering moving out.
My answer is "Yes, but." But #1 is that governments are so arrogant as sometimes to make it hard to quit, even though the resident never freely agreed to live under its rule in the first place. The FedGov requires taxes to be paid for a period after leaving, and demands the surrender of certain assets. The old Soviet governments just flat prohibited most emigration. Then there's But #2: ripping up one's family roots and changing countries is very disruptive, it's an extreme step - although all of our forefathers did, of course, do exactly that. It's outrageous that one should have to pay such a high price, just to become more free. Then But #3 is that currently, there is nowhere to go that is free of government parasites; some are less oppressive than ours but there's no guarantee they won't catch up. Accordingly, a far better solution IMHO is to stay and work to abolish government here - peacefully, totally and quickly.