The Rossoneri director has sympathised with the 46-year-old in the aftermath of his San Siro exit due to the club's poor results, with AC Milan sitting in 11th place in Serie A
The 46-year-old endured a torrid season in Serie A, with Milan winning just five of their 19 league matches thus far, a return that leaves the club languishing in 11th place and well off the pace for Champions League qualification.
Allegri - who had previously announced his intention to depart San Siro at the end of the season - was fired in the aftermath of Sunday's shock 4-3 defeat at Sassuolo and Galliani has acknowledged it was a tough decision on a personal level.
"I feel very sorry for Allegri," he told Sky Sports Italia. "Especially for how the situation has evolved on a human level.
"But this is football."
The former Cagliari boss took the reins at Milan in 2010 and guided the side to the league title in 2011.
Having lost their crown to Juventus the following season, Milan endured a difficult campaign last year and needed a late resurgence to ensure Champions League football.