It´s difficult to compare, but I think Rossi is on track to being the greatest, if he can win the next 2 or 3 championships I will have no doubt, right now I cannot say Rossi is better than Rainey, Doohan, Ago, Hailwood or Nieto, statistically he is 3rd best, behind Ago (15 times champ 122 wins) and Nieto (13 times champ 80 wins).
Though statistics can be misleading because some of Ago´s titles were won when MV was the only manufacturer in 500cc, the only opposition were private teams.
Others consider Nieto´s achievements (I don´t) not that important because he only raced in small categories.
And others consider Rainey´s titles more valuable because of the opposition he faced (Schwantz, Doohan, Gardner ...)