The Sky Blues boss conceded the the Welsh outfit were tough opposition, but was unhappy with the way his side defended corners.
"I think we played against a very difficult team - Cardiff had ten players near their own box so it was very difficult for us to try and score but when we scored the first goal I thought we played a bit better after that," he told Sky Sports News.
"Of course nobody can believe they can score two goals against us in set-pieces, but football is like that.
"You must be concentrating at those kind of places and I think Cardiff won the match, but I think we played better."
Fraizer Campbell struck twice from corners to give Cardiff a 3-1 lead after Aron Gunnarsson cancelled out Edin Dzeko's opener, while Alvaro Negredo's stoppage-time header proved to be nothing more than consolation.
"I think we didn't play well, we play a little slowly in the first half. Cardiff had ten players near their box, we scored two goals and had other chances, but the game was decided by two corners," Pellegrini added.
The result leaves City in sixth place in the Premier League, with Cardiff level on points with them in 11th.