It'll be different depending on where you are, but all I can suggest is if you do go ahead with it to word your offer very carefully so you have an easy out. Then use that time to really dig into the details of the HOA. We put in an offer on a townhouse in a complex that we were already living in. It was managed out of town but there was a local strata council. You should be given a copy of their minutes for the past year if you submit an offer. This will tell you A LOT of information about the complex - especially in regards to which ones are rentals, if their have been any noise/bylaw/other complaints made about specific units, previous problems, how healthy their reserve fund is, if they have any major capital projects coming up or what the rules are regarding adding levies.
In our townhouses there was major damage to a windstorm several years ago. An extra 20,000 was levied against each unit to repair all the damage. This was in 2010 They were still working in it when we moved in and for several months. In the process of repairs they opened the walls to discover that many of the units had not been insulated above the main floor. They were assessed another 5,000 to finish the repairs.
When we had the building inspector come in he popped his head into the attic and came down and went to his truck to get his HAZMAT gear. It looked like there had been a fire in the attic everything was black the firewall between the two units was crumbling. Then we noticed we could see sky through the roof where they had cut the hole for the bathroom exhaust and not repaired it when they redid the roof. It was all mold.
No one knew who's responsibility it was and we went back and forth with the property management company who kept putting us off. Then the day our offer was set to expire they come back with "GREAT NEWS! It is not your responsibility! Strata has to pay for it!" To which I responded with "yeah and then they'll tack on another levy that would be our responsibility" In the process of trying go get some answers I ended up just calling the president of the strata council and she mentioned that there were at least 4 other units she knew of that had varying degrees of mold issues that would need remediation. We walked.
I know for a fact that our landlord lost considerable amount of money due to all the levy's, with repairs costing that much, he basically had to absorb the loss as he couldn't just raise our rent. He lost money every month as well as once the HOA fees came out and the market was a bit of a slump. He used it as a write-off against another property of his.
My aunt on the other hand has a townhouse, sits on her strata council and loves it. It is much smaller and in a much bigger city though. I think it depends on your purpose for wanting a townhouse and seeing if that particular one you are considering is a good match for your family. The thing that has never sat well with me is you are responsible not only for our house and all your actions, but everyone else as well.