I’ve replaced a number of dishwashers and in every case like this the drain hose, under the dishwasher, had a low spot where water then mold collected.
It’s usually pretty easy to check. Most dishwashers are secured with a couple of screws to the counter top or sides. Once those are removed it should be easy to slide it out. Probably best to look up a YT video on it. But if that’s the problem the drain hose is a dime a dozen, don’t try and clean it. You’ll know if it’s the source of the smell pretty quickly.