Zidane resigned from his post just five days after guiding Madrid to a third consecutive UEFA Champions League crown, bringing an end to a short but extremely successful two-and-a-half-year spell.
It was announced that Spain coach Lopetegui had agreed terms on a three-year deal with the European champion and was due to take over after the World Cup, only for the Royal Spanish Football Federation to dismiss the 51 year-old 24 hours later.
Fernando Hierro will instead guide La Roja at the finals in Russia, but the story could have been very different had Allegri - who recently led Juve to their fourth straight Serie A title under his stewardship and seventh overall - accepted the offer from Madrid president Florentino Perez.
When asked if he had rejected Madrid, Allegri said: "Let's say I said yes to Juventus.
"I spoke to the [Madrid] president once, and I said that out of respect for the [Juve] president [Andrea Agnelli], to whom I'd given my word, and Juventus, I'd be staying at Juventus.
"It was a decision I'd already taken, and even if other things can happen in life I'd say that I made the decision to stay at Juventus and respected what I'd said, without considering other options.
"I have to thank the Real Madrid president, though, for giving me the chance to go there."
Allegri also hinted that he had been contacted by Chelsea regarding the possibility of replacing Antonio Conte at Stamford Bridge.
"Let's say that the decision to stay at Juventus had already been taken, while thanking the ones who sought me out," he said. "I've always said that the president will be the first to know if I want to leave, and the president will have to tell me if he wants to make a change."