Despite leading 2-0 from the first leg in San Siro, Milan were beaten 4-0 by Barca at Camp Nou in the last 16 of the competition, and Allegri lavished praise on the Liga leaders.
"Barcelona are the strongest side in the world," Allegri told reporters after the game.
"Lionel Messi and Andres Iniesta kept dribbling with such cool heads in stoppages, Xavi was so sharp. I have to praise my team for not giving up to the very end, as they could have let their heads drop.
"We had five players in their first Champions League campaign. Tonight's game will help everyone grow. It will be a useful experience."