AC Milan have sacked coach Massimiliano Allegri following their defeat to Serie A strugglers Sassuolo.