Dembele struck with a deflected shot in the 14th minute for a Barcelona side smarting from Saturday's home defeat by Real Madrid and rocked by the resignation of club president Josep Maria Bartomeu on Tuesday.
Juventus, still missing Cristiano Ronaldo after he tested positive for COVID-19 two weeks ago, were frustrated as Morata had two goals disallowed in the first half and a third after halftime when VAR showed that his heel was offside.
Juve's frustration was complete as defender Merih Demiral was sent off in the 85th minute and Messi settled the match with a stoppage-time penalty to leave Barcelona top of Group G with six points and Juventus on three.