The 36-year-old also collected 35 consecutive points on serve on his way to a 5-1 lead in the third set.
But 27-year-old Dane Wozniacki, the victor at Eastbourne last week, crashed out in a 6-4, 1-6, 7-5 defeat to Russia's world number 35 Ekaterina Makarova.
Federer's quest for a ninth Wimbledon crown gained momentum with a flawless 6-4 6-4 6-1 win over Slovakian world No 73 Lacko in 89 minutes.
"I'm happy to be back at Wimbledon".
However, Wozniacki still can't seem to get comfortable at the All England Club - especially when there's a swarm of bugs flying around her head. "I thought she had to improve a lot to be a contender after the first game, and after what we saw today, she is a contender".
His next opponent, Struff, outlasted big-serving Ivo Karlovic in their second-round match to win 6-7 3-6 7-6 7-6 13-11 in three hours 54 minutes.
Number-two seeded Caroline Wozniacki was upset at Wimbledon by 35th-ranked Ekaterina Makarova of Russian Federation.
"It's been good. I've never fallen out of love with the sport".
In the morning, Victoria Azarenka, who has a one-year-old son, lost to the seventh seed, Karolina Pliskova. The eight-time champion Roger Federer shared a video where he said: '[The] first day at Wimbledon, just walking past court 18, still my favourite match [John] Isner against [Nicolas] Mahut, I still wish it was going on.
With both women playing fine tennis and moving each other all round the court, Makarova earned three more match points and converted the second.
"I think (what's) important when you want to serve well is your point-for-point mentality, saying, maybe, 'The first point is as important as a break point, ' so the concentration is the same", Federer explained.
"She played well the first set".
On Court One, Serena's sister Venus Williams had to recover from a set down in successive contests to prevail 4-6, 6-0, 6-1 against Romania's Alexandra Dulgheru for a place in the third round.
American 10th seed Madison Keys, the 2017 US Open runner-up who also reached the semi-finals at this year's French Open, will be favourite to overcome world number 120 and qualifier Evgeniya Rodina, who has won five matches en route to this stage.
Fifth seed Juan Martin del Potro thumped Spaniard Feliciano Lopez 6-4 6-1 6-2 in 95 minutes to move into the third round.
However, Swan crashed out of the tournament losing 6-0, 6-3 to Mihaela Buzarnescu.