Bayern won't sell Lewandowski.
If he asks to leave then its possible as long as the price is right and Madrid can certainly pay whatever is necessary. The move would make sense to him too since Madrid is a step up on Bayern. Maybe Benzema will be sold while Lewa and morata are the replacement?
At first i'd say that he'll stay in Bayern 100% since he really wanted a move there and it's a good location for him and his wife (close to Poland), but after reading the latest interview with him i'm not that sure.
His agent openly talks about Real's offer and look at some Lewandowski's quotes (i think the source is Spiegel):
"I've never lied to a fan. I never said I'd end my career somewhere, I've never kissed a club crest after a goal. That's all rubbish and has nothing to do with the real business."
"My contract in Munich goes on for three years, my wife and I are happy here. It's a great club with good fans, the city is great with the mountains, lakes and cultural offerings. On the other side I've been in Germany for six years and have won everything. "
"Contracts are not a holy relic in football. You can like this attitude or not but it's the truth. Sometimes you have to think about if it is meaningful to try out a new impulse."