When your garbage disposal stinks it can flavor the air of your entire kitchen. The smell is coming from debris that is caught and building up in the disposer as well as the drainpipes under the sink all the way to the water in the p-trap. The water in the p-trap acts as a liquid seal, which prevents odors from sewer gases from entering the house so any odors you are getting, are from the house side of the water seal of the p-trap.
The best way to avoid getting smells from your garbage disposal is to prevent build-ups of debris in the pipes from forming in the first place. Run plenty of water when grinding food waste and run the water long enough that it will carry waste out of the drainpipe without leaving it to set and adhere to the drainpipes. Fill the sink with hot soapy water and drain the water out of the sink with the disposer running to flush the disposal and pipes at least once a week. Also some foods are worse than others to grind when it comes to odors, chicken skins is one that comes to mind. If you avoid grinding these items and regularly flush out the disposal with hot soapy water you may never have a smelly disposer.
Once a disposer starts to smell there are a number of remedies that work. One easy to try method that many people use is to put citrus peels such as lemon, oranges, or, lime along with a cup of ice cubes in the disposal and grinding them. Citrus actually cleans quite well and some people also add an additional dose of lemon juice concentrate into the mix. The ice grinding will be quite loud but the action of them banging around in the disposal will actually provide a scrubbing action on the interior of the disposer as well as the pipes with the citrus helping to clean which also leaves behind a pleasant scent.
There are also many disposal cleaner/deodorizers that are commercially available which work quite well. Some of them are more of a deodorizer than a cleaner while some clean and deodorize the disposer. Plink is available in tablet form which many users feel is more of a deodorizer than a cleaner. Oxi-Home Elements Garbage Disposal Cleaner comes in a pouch and has a scented foaming oxygen-bleach formula, which cleans and deodorizes. Disposer Care is another lemon scented bleach based foaming cleaner/deodorizer. Roebic Labs make Garbage Disposer Cleaner, which is a surfactant, bacteria and enzyme based formula.