Kaka spent six years at the San Siro before being sold to Real Madrid for a reported 70million euros (£56million) in 2009.
However, he struggled to tie down a starting berth during his time at the Bernabeu and with the arrival of Gareth Bale, Kaka would have found himself even further down the pecking order.
The 31-year-old made clear his desire to leave the Bernabeu last week and Milan wasted no time in re-signing the former world player of the year on a reported free transfer.
His arrival came after the departure of Ghana international Boateng who joined Bundesliga side Schalke after three years in Italy.
Allegri told Sky Sports Italia: "With the departure of Boateng we were without a playmaker.
"Ricardo's arrival will allow us to make a quantum leap from the technical point of view."
Allegri's own future had been the subject of debate with reports earlier this year claiming he would be leaving Milan.
However, the 46-year-old remains where he has been for three years following his move from Catania.
He said: "Leave Milan? I never came up with the idea of saying 'enough, I'm leaving.'
"I would have hated to leave Milan after only a year of the new contract.
"I wanted to play in the Champions League with this team, I did not want to leave these guys and these fans.
"The relationship with (president Silvio) Berlusconi is good, although, occasionally, there is some divergent point of view."
Allegri also admits he would like to take on the Italy coaching role at some point in the future.
"For a coach's dream, the desire is to train a national team of his country, and it is for me," he added.
"Now I am at Milan and I'm glad, the national team has a great coach.
"The national team job is one thing to aspire to, in another five or 10 years I'd do it."
Kaka then published an open letter to Real Madrid fans on his Twitter feed describing his four years at the Bernabeu as "one of the best parts of my life".
He wrote: "Four seasons of work and dedication. In these four years wearing the Real's white, I won three championships [trophies] and could enjoy the love and respect of a great club.
"Going back to Milan is a new page of my life, but I'll keep in my heart all the great moments in Spain being sure that I did all my best for the success of the team. Being part of the history of such a great club like Real Madrid is one of the best parts of my life, even though I passed through some difficult moments.
"Let me thank you all, my colleagues, coaches, all the employees of Real Madrid, the management, the president Florentino Perez, all Real Madrid's fans and all the others around the world that supported me through these years."