Allegri has endured a turbulent start to the season at the San Siro, with Milan trailing Serie A leaders Juventus by 11 points after just seven matches.
Galliani is under pressure to remove Allegri following a disappointing 1-0 defeat to city rivals Inter Milan in their last match, but he has insisted that Allegri remains the right man to turn things around.
He told the club's official website: "Allegri's last game for the club won't be against Lazio in Rome or against Malaga, or against Genoa at the San Siro next weekend.
"The club will continue with the coach that has put the most points on the table in Italian football for the past two-and-a-half years.
"Inter ended last season with 22 points less than us and no one mentions that. The same is true for Juventus two seasons ago."
Milan face a tricky trip to the Italian capital to take on Lazio this weekend, looking to improve on their unfamiliar mid-table position in the Serie A standings.