Smoke in the cockpit, makes going in Oxygen through your mask ... very dangerous.
The oxygen won't leak out of a properly fitted mask.
But the biggest issue is if you don't have 100 percent oxygen selected then the air that comes into the mask is all or part ambient air from the cockpit, contaminated with smoke.