Often I will enter a house and be overwhelmed by a delightful mix of pet or smoke odors along with heavy chemical smelling air fresheners. Please understand that you are not hiding the odors. You are simply mutating them into something much, much worse.
If the house has been smoked in for years, there is not much you can do other then replacing the carpet, scrubbing and painting the walls and ceilings and simply airing the house out for long periods of time. Anytime I am working with a buyer who smokes, I tell them right away that if they ever plan on selling the house, don't smoke inside.
Pet odors are a different story. If you keep litter boxes clean and use an odor absorbing litter, it can be easy to eliminate any odors. If your pets have accidents inside the house, make sure to clean them up immediately to prevent any pet urine from soaking through carpet and into any wood flooring below.
If your basement smells musty, this could be indicative of a moisture and possible mold/mildew issue. Often, simply running a dehumidifier during the wet months can keep the moisture and odor down, but it might be worth looking into further to make sure you do not have a foundation issue, especially if you have a finished basement and cannot see the foundation walls.
The bottom line is that if your house smells pleasant and clean when a potential buyer first enters, it will make a good impression and allow them to focus on the rest of house, which will in turn, increase your chances of selling.