Dishwashers can generally be deodorized by placing a cup full of vinegar on the top rack during a hot cycle. Citric acid and baking soda are other substances effective at deodorizing a dishwasher.
To deodorize a dishwasher with citric acid, place 3 to 4 tablespoons of citric acid in the bottom of the dishwasher, and let it run on hot for a few minutes, pausing it before it gets to the drain cycle. After leaving it to sit for a few hours, resume the cycle, and allow it to finish. The dishwasher can also be wiped with a mixture of baking soda and water to remove odors and stains.