Gas masks were designed for use by the military in case of a chemical attack. A mask would protect you only if you were wearing it at the time of an attack. To wear a mask continuously or just in case a terrorist attack occurs is impractical, if not impossible.
There are other problems with gas masks. To work effectively, masks must be specially fitted to the wearer, and wearers must be trained in their use. This is usually done for the military and for workers in industries and laboratories who face routine exposure to chemicals and pathogens on the job.
Also, gas masks were not designed to protect against biological agents. Gas masks purchased at an Army surplus store or off the internet do not carry any guarantees that they will work.