If you are talking about your home, you can get your ducts professionally cleaned and deodorized. That is the only way to get rid of the smoke residue from your ductwork. Also, change out all the air filters to the highest particulate type of filters you can get so it cleans your air.
You may also have to repaint some walls in your house since the smoke gets into the paint.
For your car, that is actually harder since the ductwork is small and snakes around. Most of what you smell is from the smoke in the upholstery, headliner and carpet which is extremely hard to remove, but it will help again if it is professionally cleaned.
There may be some substances that can be shot through your car's a/c / heater vents at the place that does your interior, but after restoring cars for over 30 years I have not seen anything that really works well short of replacing everything.
If you are talking about the heater and air conditioner in your car you could try getting your cabin air filter changed. Most vehicles have a cabin air filter that will hold the smell of the smoke. Most places that are willing to change the cabin air filter will also offer a special spray that they spray through your system which will kill the smell and any bacteria, mold or other bad things out of your system.
Now if you're talking about your home and you have forced air, then I would recommend spraying Ozium into your intake which will kill the bacteria and eliminate the smell as well.