Burnt hair smells bad because the heat from the fire releases the smell of sulfuric acid. There is a lack of volatility in sulfuric acid compounds, so they move slowly, leaving the burnt hair smell to stay in the air for a long time.
A fibrous structural protein called keratin makes up human hair, and it contains a lot of cysteine. This is responsible for holding the keratin together so that hair has structure. Cysteine is a type of amino acid, and it contains sulfur. When oxygen is low, the sulfur smell is stronger and reminiscent of rotting eggs.