the quality of the foam topper. Or perhaps the size. After a while I suppose the odors disperse. For a pillow I found it ok after I let it air a while before use. Didnt seem as noxious an odor though to begin w. and I am highly sensitive. So usually you can tell right away by its odor when you buy it.
But for a mattress or topper I would be more wary. I tried a memory foam mattress and had an instant reaction and it had to go right back.
What I found more effective and didnt have that allergic response was Latex. Similar conforming properties to memory foam but with a slightly firmer feel as Memory foam tended to have to much give after a while. Plus I think Latex mattresses or toppers are actually a naural latex rubber. It does not draw dust mites like traditional mattresses and is long wearing. I have ME/CFS, FMS, CMPS, DDD, MCS, etc. I find my latex mattress very good. It has a firmer underside with a softer topper. and you can get just the topper if you cant afford a whole new mattress.
I toss and turn alot less. and didnt have to worry about chemical smells.