Are you talking about a “gas” mask or a full face or half face respirator? The difference is that a gas mask is designed for zero ability of gas to get in. This includes air. It will have an air supply system with it. SCBAs are for this application. The air pressure inside the mask is usually slightly higher than outside the mask making it impossible for gases to leak in.
If you are talking about something that filters air, you are not usually talking about something that will block out smoke (or viruses). They have screw in filters that can be swapped out for different applications (dust, chemicals, etc). But with the filter type masks, you are breathing in through a filter. You are getting air into your lungs from outside the mask. So gases can also get through the filters. Some filters might have something like activated charcoal to help filter out contaminants, but poisonous gases could still get through.