Dogs love to roll in things like dead animals, manure, and garbage. This is an instinct, which lets them cover up their own scent while hunting for prey. The only way to stop your dog from doing this is to not give him the option. This may be easy as far as the garbage, but not easy if you let walk you’re dog walk off his leash. The best way is to train him effectively and have him listen to your commands and be rewarded for obeying them.
Should the temptation to roll in something smelly be just too much to bother following commands, he can at least learn that if he does this he will not be allowed in the house or to jump up on you. At least this way he isn’t sharing his smell with you!