An N95 or P100 rated surgical mask will filter out up to 99.997% of things like TB, Inhilation anthrax and airborne smallpox among other things. It is useless of course against any chemical attack.
While not a permanent solution it may get you out of an unpleasant situation to a safer area.
The key to these masks is the seal. I plan on duct taping the edges to get a good seal if and when the time comes. The size, price and convenience of carry of these masks make you more likely to take one with you.
A good fitting "NEW!" high rated gas mask is the way to go albeit expensive, no less than $150 for a good one. Don't even think of buying a used surplus mask of any kind. They are surplus for a reason. The failure rate on new masks is high enough let alone used.
Should you buy one?
To tell you the truth, I don't know.
But one thing I do know is when you need one the most there won't be any.
Mike