If you add a cup of ammonia to a washing machine full of water, it will kill mold/mildew and erase any musty or nasty odors, including pet stains, mold/mildew or tobacco.
It doesn't break down textile fibers like chlorine bleach and it leaves no odor of its own - it will just smell fresh and clean when it's dry.
Don't use the sudsing type - just clear ammonia or whatever scent that doesn't say "sudsing" or "sudsy" on the label.