Actually, it could happen, but it doesn't make sense if Xabi Alonso would leave Leverkusen and join Bayern Munich just for the reason of wanting to gain achievements or experience in bringing the club to the Champions League title.
Leverkusen and Bayern Munich are popular clubs who are very wise in making decisions and Bayern Munich's management will not easily trust a coach who has just achieved good results in the Bundesliga, while Leverkusen will also not let Xabi move to Bayern Munich because it could endanger the competition in next season.
It would make more sense if Xabi moved to another league, such as the Premier League, to join Liverpool, although there is no guarantee that he will gain good experience as a coach, but at least that is a more sensible choice.
It will be very difficult for Alonso to turn down the offer that comes Bayern Munich, I think at the moment Leverkusen is like just a ladder for Alonso to coach a bigger club and I think next season it will be realized if Alonso accepts the offer to coach Bayern Munich, next season Leverkusen does have the opportunity to qualify for the Champions League and so does Bayern Munich, But in this case we also need to see which team will be more competent next season the Champions League, and I think it's only Bayern Munich because indeed they will try to strengthen the squad next season, while Leverkusen maybe they look great this season, but like other teams in other leagues in Europe that surprise a lot of people in one season the next season they will not be able to perform again great and I think Leicester City in 2016 season It's like Leverkusen today.
I don't know why you equate Bayern Munich and Leverkusen as popular clubs where you might only say Bayern Munich as a popular club if Leverkusen this season was no different from last season, Xabi has stated why he prefers to coach Bayern Munich because the Bundesliga is relatively easier for him than coaching Liverpool in the Premier League, because he can now adapt more to the Bundesliga, of course, he will choose to stay in the Bundesliga in order to increase his experience in coaching and coaching Bayern Munich of course another ladder for Alonso to possibly reach the Premier League in the future.