Here's an example of the "towns" within Ulster county in NY ..If carved up like other states, there would just be Ulster County and a few incorporated cities/ real towns (here it would be Saugerties, Kingston, New Paltz, and Ellenville). The rest would just be county land, and as long as the county is STR-friendly (which many are around the US as long as there isn't a huge city within them) it would be relatively safer to invest outside of city/ real town limits (especially if the county is poor and dependent on occupancy/ "hotel" taxes). But NY State carves up its counties into larger "towns", and gives them a lot of power to regulate STRs themselves despite some of these areas being extremely rural. It seems like small difference, but in reality these larger NY "towns" are on average more likely to limit/ ban STRs than entire counties in other states. I think of them sort of like really big HOAs.
To get a sense of what regulation looks like at a local level as it's being crafted, you can watch videos of the town of Shandaken designing STR regulations online (they put them on Youtube I believe). You'll see them weigh the pros and cons of various limitations, many of which have huge impacts on the value of investments people have already made in that town (i.e., whether STR permits which they grant to existing operators who were there before regs went into affect will be transferrable to new owners of the property .... HUGE impact on your exit options as an investor).
All of this said, there are some "towns" in NY state that have historically been dependent on tourism and are very unlikely to limit/ ban STRs. Hunter, Windham, and Jewett come to mind (but home values there make getting a decent ROI on your STR investment difficult). And then there is always investing somewhere else and getting "grandfathered in" ... which could be a lucrative investment if thought through appropriately (and if the town doesn't outright ban STRs in the future, including existing operators)