The Italian has offered several words of advice to his beleaguered counterpart, and explained the reasons behind his own departure from the Rossoneri back in 2001
Milan have endured a torrid start to their season, accruing a miserly three points from as many games in what has been their worst start at home in 82 years.
Japan coach, Zaccheroni, who managed the club between 1998 and 2001, believes the club's future is still in Allegri's hands and backed him to find a solution.
"A coach must learn to cope with certain situations and not be influenced by external circumstances," the 59-year-old told Gazzetta dello Sport.
"It's not easy to strike a balance, but at some level, you have to know what to do.
"I had succeeded in this while at Milan, despite being stung by the president [Silvio Berlusconi] and having multiple injuries to contend with.
"The fans were on my side, and when we were doing well again, the club offered me a contract extension. Given the conditions I had been exposed to earlier however, I could not accept the proposal."