Having eased past Kirsten Flipkens in the first round, Wozniacki - whose two career titles on grass have both come at the tournament - overcame Petkovic 6-4 6-4.
Eighth seed Aryna Sabalenka is Wozniacki's next opponent in what is a rematch of the 2018 final.
Wozniacki secured a straight-sets triumph as she cruised towards the title, but Sabalenka avenged that defeat with a win in the pair's most recent meeting in Toronto.
Reigning Wimbledon champion Angelique Kerber got the better of Samantha Stosur to clinch her place in the round of 16.
Kerber recorded 15 winners and broke Stosur four times to set up a tie with Rebecca Peterson, who beat Lesia Tsurenko.
Sixth-seed Simona Halep dropped two games against Hsieh Su-Wei, claiming a 6-2 6-0 win in 53 minutes, while Johanna Konta survived a second-set fight back from Maria Sakkari to win 6-4 7-6 (7-4).
Sloane Stephens lost in three sets to Jelena Ostapenko, who will face Ekaterina Alexandrova after her win over Belinda Bencic.