Inappropriate things can happen on massage tables. Swedish massages sometimes turn illicit in a matter of rubs...or tugs. Towels are tossed to the wind. Whether it's legal or not is another story entirely.
There's an elaborately coded language to describe these illegal liaisons. "Table shower" or "body work" are the most commonly used phrases to describe hand jobs and other eyebrow-raising acts. There are also hundreds of NSFW acronyms describing the far more specific things that can and do go down. This is deeper than happy endings. Just look at the sketchiest reviews of "massage parlors" on Yelp.