Probably depends entirely on what the odor is. I bought a rug once that had cat urine odor which is notoriously hard to get rid of. A product called "Anti Icky Poo" (I know, dumb name) got rid of it completely. Spray it on and leave it a few days or a week. It works by breaking up the organic molecules that produce the odor. Might work as well on any other odor with an organic source. Got it at a local vet's.
JV
JV