Luka Doncic's 35 points proved in vain as the Oklahoma City Thunder rallied late to beat the Dallas Mavericks 106-101.