Dybala showed his class with a great finish but was forced off midway through the first half three days before a Champions League clash with Chelsea, having seemingly sustained a muscular problem.
Leonardo Bonucci doubled Juve's lead from the penalty spot, but Maya Yoshida's header gave Samp hope just before half-time at the Allianz Stadium on Sunday.
Manuel Locatelli's first goal for the Bianconeri gave them breathing space and although Antonio Candreva's strike set up a tense finale, the Turin giants secured a back-to-back Serie A home wins – and their first at home this season – in boss Allegri's landmark match.
Dybala put Juve in front with a fine finish in the 10th minute, rifling into the bottom-right corner with his left foot from outside the penalty area after Locatelli had set him up.
Alvaro Morata failed to beat Emil Audero when he went one-on-one with the Samp goalkeeper after being slipped in by Dybala, who was the best player on the pitch before he was replaced by Dejan Kulusevski just 22 minutes in.
Bonucci took the armband from an emotional Dybala and he doubled Juve's lead in the 43rd minute after Nicola Murru handled Federico Chiesa's shot.
The Bianconeri had only just finished celebrating when Yoshida rose to nod in Antonio Candreva's inviting cross to half the deficit just before the break.
Locatelli restored Juve's two-goal advantage 12 minutes into the second half, though, slotting Kulusevski's cutback into the empty net to punish Omar Colley for a terrible pass inside his own area.
Audero showed sharp reflexes to palm over Rodrigo Bentancur's rasping drive and Morata failed to round off a swift break when he fired wide.
Candreva finished clinically with his left foot against his former club when Adrien Silva picked him out seven minutes from time, but Juve held on to secure three much-needed points.