The Wales superstar needed just 57 seconds to put Real a goal up in Warsaw, the second-fastest goal in UCL play this season after Edinson Cavani's 42-second strike against Arsenal in Paris.
Los Blancos have failed to score only once in their last 47 Champions League group games (Paris Saint-Germain 0-0 Real Madrid, October 21, 2015).
Mateo Kovacic salvaged some pride and a now 27-game unbeaten run for the European champions when he slotted home five minutes from time.
Real are second in Group F on eight points, two behind leaders Borussia Dortmund, who qualified by beating Sporting Lisbon 1-0.
They're now sitting at the top of the table in both competitions and are the only team in the top five major leagues that are still undefeated (Bayern recorded only one defeat - against Atletico Madrid, while Nice are undefeated in the Ligue One, but have suffered two defeats in the Europa League).
However, Legia hit back with a stunning effort of their own as Odjidja-Ofoe finished off a fine individual effort by firing into the top corner.
But the unreal atmosphere seemed to inspire the home side as Madrid - who struck the bar in the last passage of play - ultimately fell flat.
Fabio Coentrao's left-wing cross was headed on by Cristiano Ronaldo and the ball bounced once before Bale twisted his body and dispatched it into the top corner with a knee-high half volley. Real are eager to tie all their key players down to long-term deals with a transfer ban in place and Dani Carvajal is also close to the top of the board's list of players due to be offered new deals, El Larguero said.
The Spanish side then nearly claimed a victor with the last act of the game when substitute Lucas Vazquez smashed against the crossbar, but that would have been harsh on a Legia side that turned up in style in the absence of their fans.