Nagelsmann has impressed at the helm of Hoffenheim, where he became the youngest ever Bundesliga coach when he took over in February 2016 at the age of 28.
The German has been linked to Bayern after guiding his side to a shock 2-0 league win over Ancelotti's men on Saturday, and added to speculation by suggesting it was his dream.
"I think it's totally normal that one young manager, good manager like Julian has a dream to train a top club," the Italian told a news conference.
"Also, he's German, it's absolutely normal and last year I told him that maybe in the future I wish him the best to be the manager of a top club."
Hoffenheim are flying high in second in the Bundesliga, while Bayern are sixth after their surprise defeat.