Short answer: It depends entirely on where you are. There is no universal legal standard.
Laws vary by state, county, and municipality. Most states criminalize prostitution—defined as sexual acts for compensation. "Happy ending" massages typically fall under this definition. A narrow exception exists in certain rural Nevada counties where licensed brothels operate legally, but standard massage parlors are not included.
Under the Protection of Communities and Exploited Persons Act (PCEPA), purchasing sexual services is illegal; selling is legal but heavily restricted (advertising, third-party involvement, proximity to schools). Massage businesses offering sexual services face significant legal risk.
Selling sex is legal, but running a brothel, kerb-crawling, and pimping are criminal offenses. Many "massage parlors" operate in a legal gray zone, often raided under brothel-keeping laws.
Approaches differ sharply: Germany and the Netherlands regulate sex work; Sweden, Norway, and Iceland criminalize the buyer (Nordic model); other countries fall somewhere in between.
State-based: legal and regulated in NSW, Victoria, Queensland; criminalized in Western Australia and South Australia.
Widely illegal on paper, but enforcement varies enormously (Thailand, Japan, Philippines, etc.).
Check your specific city/county ordinances and state statutes. Consult a local attorney. Never assume legality based on advertising, prevalence, or word-of-mouth.