Yep that is a valid question. If they refuse to pay and the state suspends their ability to operate via some license etc etc, is that legal.
I have wondered myself similarly, if say Nashua fines me, a non resident of Nashua, for a mask ordinance - how do they make me pay? A resident they could press you next time you try to renew a registration, all sorts of things, but can the state extend it's arm over a town fine? What if I refuse to appear in court over a similar town violation, can they issue a bench warrant? Seems very strange to me these town "laws", really don't know.