The 46-year-old Allegri was fired by Milan in January after 3 1/2 seasons with the squad, having led the Rossoneri to the Serie A title in his first year in charge in 2010-11. He also previously coached Grosseto, Sassuolo and Cagliari.
"It was like a lightning bolt in a clear sky when I was called yesterday," Allegri said after signing a two-year deal. "It's an honour and I realize how important it is to coach Juventus. I'm here to help this squad continue to win."
Conte led Juventus to the past three Serie A titles but left by mutual consent Tuesday.
"We're closing one winning cycle and opening another," Juventus chief executive Giuseppe Marotta said. "We had to react quickly and the choice of Allegri was made to continue winning."
Conte hinted that his departure was due to differences with club officials over the transfer market. He reportedly wanted to sign highly priced players like Chile's Alexis Sanchez, who instead left Barcelona for Arsenal, and Colombia's Juan Cuadrado, who is still entertaining offers to leave Fiorentina, but the club didn't agree.
Instead, Juventus has gone after Manchester United left back Patrice Evra, Real Madrid forward Alvaro Morata and Hellas Verona striker Juan Manuel Iturbe.
"Winning is difficult. It comes with a lot of effort, especially in a club like Juventus where there is the obligation of victory," Conte said Tuesday.
Allegri had been mentioned as a possible replacement for Cesare Prandelli as coach of Italy's national team but now Conte and Roberto Mancini are the top candidates for that job.
Allegri might have to make peace with Juventus midfield maestro Andrea Pirlo, who was let go by Milan in 2011 — apparently because Allegri wanted a more physical presence in front of the defence.
Pirlo became one of the architects of Juve's title runs the past three seasons and at 35 remains a key playmaker.
"Unfortunately that year Andrea had a series of injuries and had trouble coming back," Allegri said. "There were never any problems with Andrea and I never questioned Andrea's qualities, otherwise I would be considered crazy. I'm happy to have him again after three years."
Many Juventus fans were critical of the hiring of Allegri.
"I understand the fans' skepticism, because in the space of a single day their coach was changed," Allegri said. "I hope to win them over with hard work, respect and professionalism.