Opening the flight deck door may be sufficient in some minor cases at the expense of letting smoke and CO2 invading the cabin volume.
In serious cases: Protective breathing equipment is available in the aircraft:
Smoke hood demonstration video:
Portable oxygen cylinders and masks are also available, e.g. for A320 family:
The presence of this equipment is regulated, e.g. in US by 14 CFR 25.1439:
at least one portable protective breathing equipment shall be located at or near the flight deck for use by a flight crewmember.
In addition, portable
protective breathing equipment must be installed for the use
of appropriate crewmembers for fighting fires in compartments
accessible in flight other than the flight deck. This includes
isolated compartments and upper and lower lobe galleys, in which
crewmember occupancy is permitted during flight. Equipment must be
installed for the maximum number of crewmembers expected to be in the
area during any operation.
The oxygen supply if for 15 minutes minimum:
The equipment must supply protective oxygen of 15 minutes duration per
crewmember at a pressure altitude of 8,000 feet with a respiratory
minute volume of 30 liters per minute BTPD.
These systems are already necessary to the cabin crew to fight any fire or help passengers in case of cabin depressurization.
If a safe aircraft state cannot be restored within the 15 minutes, then the fire is already uncontrollable. Over the ocean and too remote from usable airports, the crew would have to resign and ditch the aircraft to evacuate it, a last resort and risky escape action.
In the accident you mention:
- The oxygen system involvement/malfunction is suspected but not certain.
- Considering the damages to the flight deck and panels (seen below), a problem for pilots would have been to be able to fly the aircraft with missing or failed instruments and controls, in a hot flight deck atmosphere. The passengers and crews seem to owe their lives to the accident occurring on the ground.