Depends. If a fighter has continued to win while his skills are evaporating but in the end a defeat eventually happens, then its not as bad as a fighter looking at the top of his game late in his career who falls flat on his face. Ali's defeats to Holmes and Berbick were ones which everyone saw coming. Not just because he was inactive for 2 years, but lets not forget Spinks beat Ali and prior to that he was shading a few close decisions. Lewis' defeat to Rahman is an entirely different scenario altogether. Lewis and Steward would admit he was in his prime around the time Rahman KO'd him. His performances against Grant, Botha and Tua clearly were showings of Lewis firing on all cylinders. Some people might disagree, and say his prime was around 1996. Nonsense. Anyway, nobody could see the Rahman defeat coming, maybe doubters about his chin would say so, but in all honesty he was pretty much performing at the peak of powers. Lewis around 96-97 wasn't the finished article.
It depends. If you're STILL WORLD CHAMPION it should count. You go in there as the world's champion, or as the recognized number one guy, and you have THAT REPUTATION TO DEFEND. People may know you are over-the-hill but if you're still the man to beat you should also be expected to win against ordinary challengers, or not to lose too embarrisingly to excellent ones. As a great fighter who still occupies the top spot you still have a rep to defend, that's pretty basic and true. This applies to Ali (v.Spinks), or Lewis (v.Rahman - where, incidentally, Lewis did NOT enter the fight known to be over-the-hill), and Holyfield (v. Lewis), and Frazier (v.Foreman), and Dempsey (v.Tunney). Obviously, AFTER a fighter has declined down the current ratings he's no longer defending an all-time reputation - that's already gone in to the history books. If Holyfield loses his next three fights to a 4-round truck driver from Wisconsin it wont mean **** to his all-time standing.
Had Rocky came back and lost to Patterson or Liston, he would still make my top ten imo. He was the king of the 50's as Louis was the 40's and Ali the 60's70's. So that plays a role in my ranking.