Federer was forced to play two tiebreaks after Evans impressed the crowd at the Rod Laver Arena with his splendid counter-punching skills.
The 37-year-old Swiss stepped up his game in the final set to prevail 7-6(5) 7-6(3) 6-3 and set up a third round meeting with American Taylor Fritz.
"I couldn't pull away early in the match - it helps when you can sneak in a quick break," said third seed Federer. "He played very well. It was hard to pull away, to his credit."
Spanish second seed Nadal, a 17-time Grand Slam winner, looked in complete control as he struck 33 winners in a 6-3 6-2 6-2 win over Ebden.
In the women's draw, reigning champion Caroline Wozniacki needed just 66 minutes to beat Swede Johanna Larsson 6-1 6-3.
The Dane will next face Russian Maria Sharapova in a clash of former world number one players.
Sharapova, chasing her first title in over a year, broke her Swedish opponent Rebecca Peterson five times in an impressive 6-2 6-1 victory.
Germany's three-time Grand Slam champion Angelique Kerber overcame Brazilian Beatriz Haddad Maia 6-2 6-3, while twice Wimbledon champion Czech Petra Kvitova made quick work of Romania's Irina-Camelia Begu in a 6-1 6-3 triumph.