Defining “underwear” probably would come into play too.
A dude in a pair of boxer briefs would probably be fine. A dude in a full on dental floss thin bathing suit like Borat might get into trouble.
Same with a woman. Wearing granny panties and a bra would probably be fine. Wearing exposing lingerie would probably get you arrested for indecency in most places.
Location is everything to answer your question. In the Middle East, you would be stoned to death. In Middle Alabama, that is just a common sight.
Defining “underwear” probably would come into play too.
A dude in a pair of boxer briefs would probably be fine. A dude in a full on dental floss thin bathing suit like Borat might get into trouble.
Same with a woman. Wearing granny panties and a bra would probably be fine. Wearing exposing lingerie would probably get you arrested for indecency in most places.