Having purchased plenty of used clothing items over the years, from both thrift shops and eBay, I have occasionally had to deal with the problem of lingering smells. Not gross, sweaty smells, but most commonly tobacco. Sometimes all that's needed is to hang the garment outdoors (I installed a hook on my back porch for this purpose), but sometimes that isn't enough.
With many eBay sellers, they are not selling their own clothing but rather items that they have acquired to resell, so they may not know an item's history. Even if a seller states that they have a nonsmoking home, an item could arrive smelling of smoke. This happened to me a couple of months ago. I bought a flannel shirt, nothing special, for only a few dollars. In this instance I did not pay close attention to the listing regarding info about the household, so it was up to me to try to get rid of the smell.
My first step is always a normal run through the washing machine, but I avoid the dryer because it can "seal in" stains or smells, which is what I think happened to this shirt before I ever got it. Next I soaked the shirt in the washer with some Oxi-Clean, which also yielded no results. I had recently learned that Oxi-Clean now sells a more specialized odor-fighting product, Odor Blasters (I am unclear as to why it's pluralized), so I decided it was time to try it.
The product recommends using hot water, but depending on the garment that might not be a good idea. In this case I went with warm water, and since I soaked the shirt for six hours it didn't stay warm long anyway. The product itself has a fairly strong smell (I generally use unscented detergent and unscented regular Oxi-Clean), so after hanging it in my basement I needed to wait a few days for that smell to dissipate.
Once the Oxi smell had faded I could still detect a smoke smell, but it was much fainter than it had been. I decided to do one more round, and I left the shirt in the machine for longer this time, roughly a whole day. (You can opt for an overnight soak if that's more convenient.) When doing a soak with any Oxi-Clean product, I find that it tends to remain in the fabric, so I run a second rinse cycle to remove it more thoroughly. This time, when the shirt had dried and hung for several days, I couldn't detect any sort of smell except a very, very faint trace of the Oxi. A regular wash will probably get rid of that.
Occasionally I receive an item that has been washed in a very strong-smelling detergent. People do this to reinforce that a garment is clean, which is well-intentioned but unnecessary. I find most detergents have an annoying smell, which is why I prefer ones that are free of perfumes and dyes. I recently got another shirt from eBay that arrived smelling "aggressively clean." A run through the regular wash cycle did not remove the detergent smell, so I again turned to Odor Blasters. This time I soaked the shirt for only an hour, then ran the regular wash and a second rinse cycle. After drying it smelled clean, and nothing more.
Obviously the results will vary depending on the fabric and the nature of the smell, but Odor Blasters has earned its place among my laundry products.