When you taste smoke from a fire, it is the result of combustion. In other words, something is burning and releasing particles into the air. These particles are small enough to be inhaled and enter your nose and mouth. Once they reach your taste buds, you can taste the smoke.
The sense of smell and taste are closely linked. When you smell something, molecules from the object enter your nose and bind to receptors in your olfactory system. This sends signals to your brain that allow you to identify the odor. The same process happens when you taste smoke.
Tasting smoke can be a sign that there is a fire nearby or that someone is smoking tobacco products. If you're exposed to high levels of smoke, it can irritate your throat and lungs and cause health problems.