The Italian champions had trailed the Russians with 13 minutes to go in the Allianz Stadium after Aleksei Miranchuk had put the visitors ahead after half an hour.
But Dybala pulled the hosts level on 77 minutes and added a second two minutes later to keep Juventus on course in Group D with seven points after three games.
Maurizio Sarri's side had drawn with Atletico Madrid and beaten Bayer Leverkusen 3-0 in the last two games.
Atletico also have seven points, after beating Leverkusen 1-0 in Spain on Tuesday, with Lokomotiv third with three points.
Cristiano Ronaldo missed the chance for another record of scoring against a 34th different Champions League club.
The Portuguese star drew a blank in Turin firing over from a Juan Cuadrado cross early as, despite dominating possession, Juventus struggled to break down the Russians.
Lokomotiv broke through with their first clear chance.
Miranchuk shrugged off Leonardo Bonucci and the Juventus defence to find on-loan Inter Milan midfielder Joao Mario whose effort was cleared by Polish keeper Wojciech Szczesny into the path of the Russian forward who finished.
Dybala looked as if he had scored the equaliser before the break but play had stopped following Ronaldo's tackle on Lokomotiv goalkeeper Guilherme.
Dybala fired over just after the break with fellow Argentine forward Gonzalo Higuain coming on in place of Sami Khedira.
Szczesny denied Joao Mario after an hour while at the other end Higuain missed two quick-fire chances before Dybala finally rifled in the equaliser.
Alex Sandro was denied two minutes later but Dybala was on hand to follow up to keep Juventus unbeaten in all competitions this season.