Federer, 31, swept to a 6-3, 6-2, 6-0 win on Centre Court to celebrate the 10th anniversary of his first triumph at the All England Club with an impressive triumph.
The seven-time champion Swiss fired 32 winners and just six unforced errors as he clinched a sixth career victory over the 47th-ranked Hanescu.
"It's the most special thing to be back on Centre Court," said Federer, playing in his 55th straight Grand Slam and seeking an 18th major.
"I am not sure how much better I could have played. It was good to get it done quickly as it was cold and it released some of the pressure."
More From This Section
Federer came into Wimbledon on the back of his first title of 2013 in Halle, the grasscourt win taking him level with John McEnroe on 77 career titles.
"Halle came at the right time. It shows I am peaking in time for Wimbledon," said third-seeded Federer who next plays Sergiy Stakhovsky of the Ukraine for a place in the last 32.
The 23-year-old Belarusian, the reigning Australian Open champion, broke down in tears after suffering a worrying fall in the second game of the second set on Court One as her right leg gave way in her service action.
Azarenka collapsed in crippling pain before her first round match was delayed by 10 minutes for her to have her right knee heavily strapped.
"It was such a shock. I felt my whole body collapse," said Azarenka, who eventually regained her composure to book a second round match-up with experienced Italian, Flavia Pennetta.