Dishwashers which are properly installed and regularly used won't normally have a problem with bad odors.Even though manufacturers insist that you can throw dirty dishes in the unit with food on them, common sense tells us this food has to go somewhere. Usually, the particulate is held in some type of filter until the drain cycle, where it is expelled along with the water. Check the following first:
Was the drain hose brought in at the top of the cabinet, or down
near the floor?
(See video below)
Do you run the unit at least once every 2 days? (recommended) Run a cycle with a quart of vinegar to clean the tub and pump.
Does the disposal tend to back up slightly when the dishwasher drains? (Drain may be clogged or disposer may have dull grind blades.)
Don't use gel detergent!
Check your water softener. (If so equipped) These can cause foul odors in the water supply if not properly balanced or maintained.