There are many things that can cause odors in dishwashers, such as a clogged filter, food debris, blocked water jets and backfilling. Backfilling is caused by waste water that returns to the machine when it is not in use and this happens if the machine is not fitted correctly.
Food debris is a common problem in dishwashers due to the nature of the machine. The odor can come from the food's original smell but because the machine is hot and humid, food will also decompose. This can be combated by checking the spinning arm and the bottom of the machine for any food debris and cleaning it regularly. If there is a problem with food accumulation, scraping any excess food off of dishes before placing them in the machine can help. A clogged filter stops water from draining properly and accumulates food debris which can cause odors. Each manufacturer has different instructions on how to clean a filter and these are detailed in the machine's manual.
The water jets in the machine can get clogged at times; it is important to check and clean them so that clean water can flow more easily. If dishes build up in the dishwasher for a couple of days, a rinse/hold cycle can be used every day to keep odors at bay. Additionally, adding three tablespoons of baking soda to the bottom of a dishwasher can help absorb odors.