Sterling has started the new season in sensational form, scoring eight goals in seven games for Manchester City and England.
After two fine displays for England this week, national boss Gareth Southgate said Sterling has the potential to become as good as the duo.
Guardiola says “nobody can compare” with them currently but that Sterling should aspire to reach that level.
“It would be a dream for him, for all of us,” said the Spaniard.
“If Raheem can target that level – wow.
“We will be here to help him and of course he can do it but I will not be the guy to put limits to cancel it, to say ‘don’t, don’t think about that’. No, absolutely not – I want it.
“But right now, nobody in all the clubs in the world can compare with these two guys and what they have done every single week during 10 years.
“They are absolute legends and nobody can compare, nobody.”
Sterling has scored eight goals in eight appearances for club and country this season, including in both of England’s Euro 2020 qualifiers against Bulgaria and Kosovo.
Guardiola says he hopes Sterling does not get distracted by the praise for his performances.
“I’m so happy for him, for the way he’s playing here and with the national team, but hopefully he won’t read too much,” he said.
“He cannot listen to these kind of things – that wouldn’t be good for him, because nobody can compare with Cristiano or Messi.
“I’m so happy with what he’s done since we’ve been together, not just right now. Everything that has happened to him has been good because he has an incredible work ethic and is an incredibly nice guy. I’m delighted for him.”
Guardiola rules out defensive signings
Guardiola also said Manchester City were unlikely to sign a defender in the January transfer window despite having just two fit senior centre-backs.
It was confirmed on Friday that French defender Aymeric Laporte will be out until February after knee surgery.
That leaves City with just Nicolas Otamendi and John Stones as centre-backs, following the departure of Vincent Kompany to Anderlecht.
- MOTD analysis: Does Guardiola trust Stones and Otamendi to cover for Laporte?
“We are going to survive with the players we have,” said Guardiola.
“My advice to you is not to write too many names about the winter transfer window because you are going to make a mistake. I don’t think it’s going to happen.
“I heard already we are interested in this player or the other player but I would like to say to all the clubs in the world don’t be nervous, because we are not interested in any players or central defenders in Europe.”
England defender Stones could play at Norwich City on Saturday in the 17:30 BST kick-off after recovering from a thigh injury that has kept him out since the opening game of the season.