If your walls are marred with smoke stains, you cannot paint directly over them, or they will retain a smoky smell. In addition, ill-prepared smoke-stained walls eventually bleed through paint, showing as discoloured areas within the finish. It doesn't matter if your walls are stained with smoke from cigarettes or fire damage, you must seal the wall prior to painting, or you will ultimately be able to see and smell traces of smoke.
The Wrong Primers
Plain water-based latex and acrylic primers work well on bare wood and drywall; however, they do not have the ability to permanently seal smoke stains. Do not apply these types of primers directly over a smoke stain, or you will see a recurrence. Likewise, do not use one of these primers to attempt to seal smelly painted walls, or the odour will return after a few days.
Oil-based Stain-blocking Primers
Stain-blocking primers are well-suited for sealing walls marred with smoke. Unfortunately, they tend to emit unpleasant odours of their own that linger in the air long after the application process is complete. Once you paint over the oil-based stain-blocking primer, the smell will eventually dissipate; however, you must wear a respirator during the application process, or you will be overwhelmed by noxious fumes.
Shellac Stain-blocking Primer
Shellac primers will also seal smoke stained walls and prevent unpleasant smoky odours. Shellac primers don't expel the same sort of intense fumes as petroleum-based stain-blocking primers; however, they sometimes don't cover quite as well. If you choose to use a shellac-based primer, apply two coats to ensure that the smoke stain and smell is adequately sealed.
Unfortunately, if you can smell smoke on your painted walls, you have no choice but to apply a stain-blocking primer prior to repainting. Don't try to wash the walls, as this will only cause the paint to fade. Don't just add an additional coat of paint, or the smell will return within a day or two.