Perhaps not, who knows. Whether it's "legally" this or that isn't really relevant though. Servers should not be in a position where they are encouraged to flirt with patrons. That isn't okay, morally. People should not be put in that position.
Imagine you worked caring for old people, but the job was tip based and you were living on the poverty line, and old people were tipping more if... I dunno, you gave them a bit of a feel when you were showering them or helping them to the toilet. Imagine if your wage was such that in order to feed your family or pay your rent, you were being incentivised to do that kind of thing in order to get tips from them. Even if it was legally okay, morally it is not. People should not be put in that position.