Bayern Munich staged a remarkable comeback to defeat SC Freiburg 3-2, overcoming a two-goal deficit in a thrilling Bundesliga clash.