Yes, it can work but it depends a great deal on the "aerosol poison" you are dealing with.
It needs to be something like chlorine gas. Chlorine works by physically damaging the respiratory tract and pulmonary system when inhaled in relatively large doses. The oxygen mask doesn't need to seal perfectly to protect the wearer and the lack of eye protection will leave the person needing to flush out their eyes when they get clear but should cause no permanent harm. You are also clear of the danger once you get past the poison fumes and into fresh air.
With other airborne poisons such as most nerve toxins or blood toxins an oxygen mask is not going to be adequate. Breathing in even a small amount could cause harm and the oxygen masks you are talking about cannot be completely sealed from outside air. An oxygen bottle contains pure oxygen, it is not a SCUBA tank filled with compressed air. 35
Breathing 100% oxygen from a bottle is better than breathing poison gas but pure oxygen can cause be just as harmful if the person breathes too much of it or too long.
Also consider that many airborne blood or nerve toxins can be absorbed into the bloodstream through the eyes or even through exposed skin. For these types of toxins you need a full mask that protects the entire face and a full protective suit. (It is possible that such protective equipment is stored somewhere in the hospital as hazmat equipment.)
Also, some aerosol poisons are intended to be easy to clear, such as the stuff used when fumigating a house. Other poisons are intended to be longer lasting. They are sprayed as an aerosol mist of tiny droplets that stick to things, including the person and their clothes. These droplets will continue to evaporate and off-gas toxic fumes long after leaving the area where they are deployed. This means that the person needs to keep the gas mask on while following a strict decontamination protocol, stripping off and discarding their clothing and showering off any residue that may be on their skin. 978