Of course Federer could only play against whoever the rival is at that moment but he won the majority of his 11 GS between 04-07 against players who can hardly be considered in the same group as Nadal, Djokovic, and Murray. So yes, in that sense he was lucky to rack up all those numbers before the 'real competition' arrived. Nadal is by far the greater of those two, won all his GS against top ten players and six times against the No1 Federer.
PS. Djokovic won all of his first 10 GS against Federer, Nadal, and Murray (bar one against Tsonga). Now compare this competition in regards to the first 10 GS that Federer won in 04-07, and you're telling me Federer hasn't been lucky?