The Serie A outfit secured the point they required to make it through to the next phase despite being reduced to 10 men when Riccardo Montolivo was sent off.
"It was a long sigh of relief because this was an important achievement and it wasn't easy to play against Ajax with 10 men," Allegri told Sky Sports News after the game.
"The lads were very organised and only ran risks on a few crosses into the box, while Christian Abbiati did well on his saves. Mario Balotelli took the team upon his shoulders, earned free kicks and held the ball up, so he was crucial."
Allegri went on to say that Montolivo's dismissal was harsh, but praised his side's defensive display at the San Siro.
"Montolivo's was a foul, but certainly not nasty, as he is not a nasty player. The referee made this decision on the suggestion of the assistant and it's a shame we had to play for over an hour with 10 men," he added.
"From the touchline I couldn't see it. The replays show it was a hard foul, but not nasty. The lads didn't allow Ajax to get past them, didn't allow spaces and I think we had a couple of dubious offsides against us too.
"It was tougher to go on the counter in the second half, as the more time went on, the more we could sense the finish line. Ah well, that's the way it went and we all lost a few kilos suffering on the touchline."
Milan finished second in Group H behind winners Barcelona.