Ronaldo was denied his second goal by the offside flag late on, before Samp scorer Caprari was sent off in stoppage time when he was shown a second yellow card.
"The whole team showed the right attitude," Ronaldo told Sky Italia. "It was a good goal and I am glad to help the team with another three points.
"I had problems with my knee for a month, but that has gone now and I feel good physically."
It was a special night for Buffon as the veteran goalkeeper equalled Paolo Maldini's record of 647 Serie A appearances and set a new Juventus Serie A appearance record of 479 games, one more than Alessandro Del Piero.
Juve boss Maurizio Sarri fielded the attacking trident of Ronaldo, Dybala and Gonzalo Higuain for the second game in a row, and his side needed 19 minutes to find the opener as Dybala struck a sublime volley into the bottom corner.
Sampdoria drew level 10 minutes before the break when Caprari swept a finish past Buffon after a defensive mix-up.
But Juve went back in front through an extraordinary Ronaldo header, as the Portuguese was calculated to have jumped 71 centimetres off the ground to meet Sandro's cross at a height of 2.56 metres, before powering home.
"Ronaldo did something that you see in the NBA [National Basketball Association], he was up in the air for an hour and a half," said Sampdoria coach Claudio Ranieri.
"There's nothing you can say about it, you can only congratulate him and move on."
Ronaldo, who has six goals in his last five Juventus appearances, thought he had his second when he rounded goalkeeper Emil Audero to roll the ball into an empty net, but the effort was disallowed for offside.
The game ended on a sour note for Ranieri's side as Caprari caught Merih Demiral in the face with a flailing arm to earn a second yellow card.
Juventus head to Saudi Arabia this week, where they will face Coppa Italia holders Lazio in the Supercoppa Italiana in Riyadh on Sunday ahead of the winter break, which runs until the first weekend of January.