Question: what are hat brims made out of?
Answer: Most baseball hats today use a plastic form to shape the brim, not cardboard. The plastic can withstand a wash with no deformation. If you want to hedge your bets and be extra careful you can get one of those plastic forms for baseball hats, strap your hat into it and then throw it into the washing machine.