First-half goals from striker Robert Lewandowski, who struck with a spectacular 14th-minute overhead kick, and Kingsley Coman three minutes from halftime and amid heavy snowfall, put the German champions in front.
Dynamo, who are now eliminated from the competition, cut the deficit with their maiden group-stage goal through Denys Garmash in the 70th.
They then forced Bayern keeper Manuel Neuer to make a fine save in the 75th and hit the post in stoppage time as they looked for an equaliser with a strong finish.
The Bavarians, desperate to bounce back from Friday's shock 2-1 loss to Augsburg in the Bundesliga, top the group on 15 points with five wins from five games.
Barcelona, who face Benfica later, are in second place on six and the Portuguese side are third on four, with Dynamo bottom on one point.