Sampras would have the edge over everyone, including Federer on grass and hardcourts. Pete won 2 Australian opens and 0 French opens. Pete flourished at Wimbledom winning a record 7 championships. At the US Open, he is a 5 time winner and a runner up 3 times. Had he won those 3 finals, he would have 8 US Opens, 1 more than even Wimbledon. None of today's top players, including Federer can claim such dominance on grass or hard courts.
I know some will then say, well he lost 3 times at the US Open finals. Pete has Thalassemia Minor which is a blood disorder that causes shortness of breath and weakness, loss of energy. If we look at the history of Pete's matches we do notice a trend to how the elements affect his performance.
The Australian and French Opens are probably the 2 most physically demanding tournaments of the grand slams. The extreme sun, heat and temperatures there give an edge to athletes who have the best conditioning and fitness. The weak sunlight at Wimbledon is less demanding on the athletes and makes for more optimal playing conditions. The US Open is unique in that it has night matches which is desired by everyone, however it is probably the most humid and therefore the day matches are still very difficult and dehydration is a problem.
Pete dominated under the Wimbledon fog where the cooler temperatures and playing conditions were more ideal for his condition. When Pete lost to Safin/Hewitt in the sweltering hot sun of the 2000 & 2001 US Opens, he was clearly several steps slow. A combination of his age, previous grueling matches, and his anemic condition may have finally caught up with him.
As some posters have mentioned, with another day's rest before the final and Pete could potentially have 7 US Open titles to his credit, his loss at a young age to Edberg being his only blemish at US Open finals. (While I think they are lucky to have met a empty tank, non-competitive Sampras in the final, Safin/Hewitt did reach the finals and raise their game so they full deserve the title and Pete only deserves to be known as a 5 time US Open champion. Poor Pete!) If the final would have been played at night during cooler temperatures, I would also pick him over Safin and Hewitt.
Pete has never lost a night-match at the US Open and holds a perfect 20-0 record.
Watching Pete, I always thought that his pure game was the most dominate of any that I have ever seen and that his only weakness was his fitness and conditioning being suspect under extremely hot temperatures and tough schedules. Obviously this would affect him more as he got older and that is why he tanked in those 2 US Open finals. However a young Sampras would be my favorite to win on grass or hard courts against anyone that is playing today.