Swiatek will next face Sabalenka in the semifinals, while Gauff will lock horns with Pegula for a place in the final.
American Pegula booked a semifinal spot at the season-ending tournament with a 6-3, 6-2 victory over Sakkari.
Coco Gauff won the final 10 games of her match against Elise Mertens, completing a 3-6, 6-3, 6-0 comeback
Djokovic defeated Poland's Hubert Hurkacz 7-6(6) 7-6(6) 5-7 6-4.
Retired Swiss great Federer received possibly the longest ovation of his illustrious career on Tuesday.
Friday's draw at the All England Club pitched women's top seed Iga Swiatek against China's 33rd-ranked Zhu Lin, a potentially tricky first hurdle for the Pole.
The Wimbledon champion said she had been unwell for the last two days and was out of breath during the warm-up before her match against Sorribes Tormo.
Elena Rybakina also booked a third round spot with a 6-3, 6-3 victory over rising Czech teenager Linda Noskova.
By winning her 30th career title, the former world No. 2 Kvitova will now re-enter the top 10 for the first time since September, 2021.
Sabalenka surged into the final with a 7-6(1), 6-2 win over unseeded Pole Magda Linette to extend her unbeaten start to the year.