The foul odor you smell when you turn on the hot water is almost always harmless, odor-producing bacteria. Having a water softener speeds up the process of bacteria accumulating, which produces a foul smell. All water heaters have an anode or magnesium rod that causes more bacteria to form.
All you have to do is replace your magnesium rod with an aluminum/zinc rod. Then, add a pint of bleach into your water supply to kill the bacteria present, and run the bleach water through all of your hot taps in the house. You need to get rid of the bleach water because you certainly don't want to be drinking that! You can get a plumber to help you out with this because he understands that this is a proper solution to permanently get rid of the foul odor in your water supply.
Additionally, you might consider getting a water softener to reduce the iron particles in your water. Iron particles cause the water to be harder, and the smell from the iron particles can cause a sulfur or rotten egg smell. Getting a water softener reduces the iron particles enough so that the drinking water will not be harmed, and the smell will be reduced or completely eliminated.
However, there could be another reason why your water smells bad – infrequent use of your water heater, such as in vacation homes or second homes. This solution is not as easy as just replacing the magnesium rod and adding a water softener.
You will have to rig a plumbing assembly onto your water heater and pour a couple pints of regular, drug-store hydrogen peroxide into the tank. It is best to get a plumber to help you do this, as it is a difficult process. Fortunately, the process itself is fairly cheap, so you can actually afford a plumber to do it for you! After you perform this procedure, the hydrogen peroxide will become diluted in the water system, and because it's already a very low concentration, it won't harm you when you use your water supply again. And best of all, the smell will finally be gone.
There are many reasons as to why your water supply could have a foul odor. Some are bad for you in the long run, some are easy to fix, while others are a bit more complicated. However, as long as you stay informed about what you need to do for the problem you're having, you can easily get help doing it quickly and efficiently without being tricked into doing something you don't want to do or can't afford.