We can easily advise regarding the real estate requirements of a licensed professional.
However, your question SPECIFICALLY asks 'is it legal' which is a question only an attorney can answer. They practice law (legal) we abide by the professional standards of the state license board of the state in which we hold license.
Let me ask you, "How long does smoke smell endure in a house?"
Can the smell endure through multiple ownership?
I'm selling a house right now where the owner strenuously denies anyone has ever smoked in the house. I don't smell any. But buyer report after buyer report suggests cigarette smoke.
Has the olfactory glands of USA citizens become so sensitive they 'hit' on any smell other than Frabreeze?