This transfer indicates that the 39-year-old midfielder, who announced his departure in May from Madrid after the Club World Cup, will conclude his 13-year tenure with the Spanish giants.
"Modric will arrive in August. He is an exceptional player," Allegri told reporters during his inaugural press conference as Milan manager.
Real will face Paris Saint-Germain in the semi-finals of the Club World Cup on Wednesday, with the final set for Sunday.
Modric, the 2018 Ballon d'Or recipient, will join a Milan team aiming to recover from a disappointing season that saw them finish eighth and miss European competition.
"To the fans, I emphasize that the most crucial aspect is to work diligently every day," Allegri stated. "The only way to regain respect is through accountability and by delivering results. We will definitely need their support."
The Italian, who has returned to Milan for a second stint after replacing the dismissed Sergio Conceicao at the end of May, also highlighted some significant changes to the squad ahead of the upcoming season.
Dutch midfielder Tijjani Reijnders was transferred to Manchester City in June, while French left-back Theo Hernandez might be heading to the Saudi Pro League club Al Hilal.
"Although Reijnders and Hernandez will not be part of the team next season, (goalkeeper) Mike Maignan and (forward) Rafael Leao appear to be willing to stay," Allegri remarked.
Milan will begin their Serie A season on August 23 with a home match against Cremonese.
Allegri, who previously led Milan to a Serie A title in the 2010-11 season, last managed Juventus.