That left the visitors a man down and Dybala made no mistake from the spot to claim his third goal in the competition.
Juve could have had a second goal just after the restart but Casillas produced a fine reflex save at his near post to stop a wayward header by Porto midfielder Danilo.
Minutes later Buffon rushed out to close down Soares after he escaped Sandro to fire an angled shot wide of the ‘keeper’s far post.
Allegri replaced Juan Cuadrado with Marko Pjaca for the start of the second half and the Croatian starlet saw an angled effort spin past Casillas’s far post after he controlled well under pressure on the edge of the area.
Higuain, on 66 minutes, then fired just wide after holding off two markers in the area in what was Juve’s last real chance to add to their tally.