Mario Balotelli converted the penalty in stoppage time to score his second of the game and complete a dream debut for the Rossoneri and a starring return to Serie A.
However, Thomas Heurtaux clearly got the ball in his tackle on Stephan El Shaarawy, and Allegri accepted that his team were lucky to get the opportunity to claim all three points.
“We were lucky when it came to the referee’s decision,” he told reporters after the match. “I am pretty honest when it comes to evaluating incidents and I will say that the Udinese player gets the ball. It’s certainly not a penalty that you can give.
“It is a shame, as Udinese played well and so had we. The team played an excellent first half and Udinese were non-existent during that period, while in the second we were lazy and paid the price.
“The team are young and must improve, because we can’t keep risking dropped points after dominating like this. In the second half we lowered the tempo and had too many individual moves. After the equaliser we started playing again, but we shouldn’t get ourselves into these situations.”
Allegri also took time out to praise new €22 million [£19m] signing Mario Balotelli, who was originally set to start on the bench, but a warm-up injury to Giampaolo Pazzini saw him promoted to the starting line-up.
“He played very well and has some exceptional qualities, but then we all knew that,” the Italian said. “I was also fortunate, as he wasn’t meant to start. He has to improve, seeing as he is only 22.”
Milan have soared up the table since Christmas and look like a completely different side to the one which floundered at the start of the 2012-13 campaign, but Allegri played down their hopes of breaking into the top three.
He said: “The tournament is still long and I know it is difficult to finish third, especially when we were 10 points behind.”
Allegri also dismissed speculation linking him with a move away from the Rossoneri to Roma, where Zdenek Zeman was sacked from on Saturday.
“I am happy to stay here,” he added. “After all the criticism that was aimed at me, we are ready to start a new era.”