Andre Schurrle tried to open the scoring after six minutes, but the Chelsea man's finish from outside the box went well wide.
The hosts came close a couple of minutes later when a cross was fired in, leaving Muller with a header from close range, but he stunned the home supporters by nodding the ball wide.
Muller did put the world champions ahead though when he beat David Marshall to the ball, heading in at the near post from a Sebastian Rudy cross.
Marshall was called into action just before the half-hour mark to prevent the Germans from doubling their lead, making a two-handed parry to deny Marco Reus, before Schurrle's attempt from the rebound was blocked.
Manuel Neuer had to remain alert in the closing minutes of the first half as Scotland pushed for an equaliser, coming off his line to make a clearance before denying Ikechi Anya from a volley.