You're probably more likely to get reprimanded for not wearing a brief (or "speedo") than for wearing one while swimming laps. Many European pools forbid shorts. In North America, the only time I've heard about people getting in trouble are when they wear something that is obviously meant to be provocative, like an unlined white suit that turns transparent when it's wet, they act inappropriately, or they go somewhere that expressly forbibs briefs (and often bikinis for women).
There are incidents,
like this one, where people get in trouble and claim that an establishment is being sexist, but there's usually more to the story. In the previous link, those look like shorts, not a swimsuit, and probably turned see through.
There are cases where people are asked to change for no legitimate reason, but these seem to be rare.
poolsign.jpg