Federer, hoping to win a record 17th grand slam in Melbourne later this month, thumped Russian Nikolay Davydenko 6-2 6-2 in less than hour on a blustery evening.
Top seed Nadal, in contrast, battled back from a break down in the deciding set against Germany's Philipp Kohlschreiber to triumph 6-3 6-7 6-3 in two and a-half hours. Third seed Jo-Wilfried Tsonga was also wayward in a 7-6 6-7 6-1 win over Tunisian wildcard Malek Jaziri.
Federer said he was glad to get some night-time match practice.
"It was a combination of me playing really well and Nikolay not finding his range like we're used to seeing in the past," Federer told reporters. "This is obviously an important step to get used to the conditions."
The 30-year-old Swiss has failed to win a grand slam title since lifting the 2010 Australian Open trophy but his appetite for tennis remains undimmed.
"If you don't have that (motivation), you will have many losses due to a lack of interest," said Federer.
"Your mindset has to be right and there's a lot of sacrifice during the year and throughout your career, but you get the returns and you just have to remind yourself how lucky you are."
His longtime rival Nadal, who lost the Wimbledon and U.S. Open finals as well as the world number one spot to Novak Djokovic in 2011, said he was pleased with his performance in Doha as he recovers from a shoulder injury and switches to a new racket.
"The only moments I didn't play well were the beginning of the second and after the tiebreak. For the rest, I think I played a very solid match," Nadal said.
"My shoulder is fine. I felt something at the beginning of practice, but later, after three, four minutes, when I got warmed up, I feel the shoulder with perfect condition. The shoulder needs days like today to get the power."
Nadal was in imperious form early on, sealing the first set by ending a furious exchange at the net with a simple volley winner.
The German appeared to be heading for his eighth successive defeat to Nadal but stunned the 10-times grand slam winner by racing into a 3-0 lead in the second set.
At 4-2 up, Kohlschreiber netted a backhand to give Nadal a break back. The relentless power of Nadal's shots left Kohlschreiber scrambling but he clung on to take the set into a tiebreak, which the German won 7-2.
Kohlschreiber broke in the first game of the final set, hammering a forehand winner down the line, but that stirred Nadal from his slumber and the Spaniard broke back immediately before surging into a 4-1 lead that he never looked like relinquishing.
Tsonga traded tiebreaks with the bulky Jaziri in the opening two sets of an error-riddled match.
The Frenchman then broke early in the final set and eased home as his Tunisian opponent tired.