While you certainly can wash a baseball cap in the dishwasher, you may not want to. If you have a vintage hat with a cardboard brim, you definitely cannot wash it in the dishwasher. If you do decide to go the dishwasher route for convenience, choose cold water and a gentle cycle to prevent color loss and deformation. Place the hat on the top rack, and check that your dishwashing detergent does not contain bleach. It is strongly recommended, however, that you wash by hand with laundry detergent instead to keep your hat looking its best.