There are so many dishonorable discharge puns here that one scarcely knows where to begin...
Generally, the dividing line is whether you're screwing around with the spouse of another servicemember, and whether the other servicemember makes a big deal out of it. That's the kind of stuff that affect good order and discipline.
I personally know of at least one high-ranking officer whose was nailed for this. They just don't publish that stuff, which is why some folks may think they get away with it.