Erling Haaland scored a last-gasp winner for Dortmund as they ran out 3-2 winners against TSG Hoffenheim.