Guardiola has been watching from afar as Pellegrini struggles to cope with the expectations at Real this season.
"We have a liking for the same work. Those people who criticise do not understand that a Treble is not won in October. It takes time, it is a long process," said Guardiola.
"I really wish him good luck because he deserves it, he really is a great coach."