Working in retail myself I do believe it is quite rude to go commando while trying on pants and swim wear. Also as posted earlier about the returned close being put back on the rack, what would you expect that a store should just take a loss on every piece of clothing returned. Maybe if more people tried close on in this day and age there wouldn't be so many returned close. It is generally expected in normal society that people are to wear undergarments while trying on close
"Why do birds suddenly appear
Every time you are near?
Just like me, they long to be
Close to you."
or is that "clothes to you"?
(Now you'll be singing along with Karen Carpenter all day).
A mind is a terrible thing to waste....
As for the actual issue, you take a chance every time you try on CLOTHES (the last person could have crabs!) at the store, whether you're wearing underwear or not. I don't do commando except for jeans, and I wear underwear to try them on (I like them loose, not tight---or is that "lose", another of my favorites...). When I try on clothes, I go home and take a shower. I don't wear the clothes till they've been washed or gone to the cleaners, whichever.
Other than that, there's not much you can do. Wash your hands frequently. Or, just stay inside and become agoraphobic....