Real announced the appointment of then-Spain boss Julen Lopetegui on Tuesday. Allegri, 50, told Sky Sport Italia he was also considered but turned down Los Blancos because he is committed to Juve (via Ben Gladwell of ESPN FC): "I said no to Real Madrid. I did it on the phone to [Madrid president] Florentino Perez because I had given my word to [Juventus] president [Andrea] Agnelli. I thanked Florentino for the offer, but said I couldn't accept it out of the respect I owed to Juventus."
Lopetegui was consequently sacked by Spain on Wednesday, as Gladwell reported, just two days before their opening game of the 2018 FIFA World Cup, which is against Portugal.
The Real job is not the only position Allegri has been linked with this summer.
He was widely tipped as a potential candidate to replace Arsene Wenger at Arsenal before Unai Emery was appointed on May 23, with Jeremy Wilson and Jason Burt of the Daily Telegraph reporting the Gunners planned to hold talks with the Italian in early May.
It is little surprise Allegri has been sounded out by some of Europe's top clubs.
Since taking over at Juve in 2014 he has led the Italian giants to four consecutive domestic doubles and also reached two UEFA Champions League finals.
It seems clear, though, that he is not done in Turin.
Per Sky Sport Italia, when asked about potential offers from elsewhere, Allegri said he is committed to his current club (h/t Gladwell):
"Let's just say that I had made up my mind and already given my word to Juventus. I simply informed this to all of those who came looking for me. At the moment, Juve are one of the best clubs in the world. We need to improve what we started four years ago, and I'm happy to do it with this group of directors. Agnelli is very ambitious."
In the 2018-19 campaign, the Old Lady will be going for an eighth consecutive Serie A title. With Allegri still in charge, it would be foolish to bet against them.