Federer in his prime could barely beat Nadal when he was a teenager. Federer just happened to find a sweet spot in the sport when past champions (Sampras/Agassi) were leaving, while the next generation (Nadal, Djoko) were still developing.
Federer has a losing record to Nadal, who is the only player of quality that Federer ever faced during his prime years.
Grand Slam matches: Nadal, 8–2
Australian Open: Nadal 2-0
French Open: Nadal 5-0
Wimbledon: Federer 2-1
US Open: Have not met
Outdoor: Nadal, 6–2
The only time Federer has an advantage is Wimbledon, where they met 3 times, all finals. These are also the only matches they have played on Grass. Federer won the first two matches, 2006 and 2007 Wimbledon, during which Nadal was 20 and 21 yrs of age, still developing, and it took Roger 4 and 5 sets to win.
Then, the 2008 Wimbledon final, considered to be the greatest match of all time. Nadal was 22, Federer was 26 and in the prime of his career. Close match, but guess who won, NADAL. He beat Federer at his best, on his favorite surface that favors his style of play. Federer the GOAT, i don't think so.