Sanchez only has a year left on his Gunners contract and has so far refused to sign an extension, with reports claiming that he has been offered around £250,000 ($329,000) a week by the north London club to extend his stay at the Emirates Stadium.
Bayern president Uli Hoeness played down the chances of the club making a move for the 28-year-old last week, saying the club would rather invest money on young players.
But Ancelotti suggested that Bayern could try to sign Sanchez under the right conditions.
"If an opportunity comes up, the club will be ready," the former Chelsea boss was quoted as saying by the London Evening Standard.
"There are lots of rumours. Alexis is a great player but not the only one in the world. I like Alexis.
"There are possibilities in the transfer market, which can be in many directions. I believe that the market is currently somewhat crazy and Bayern is not a crazy club.
"I know the culture of this club and will not ask for any players for whom the club has to spend crazy sums, but if there are occasions, why not?"
Sanchez has also been linked with a move to Manchester City, although Arsenal are understood to be reluctant to sell him to a rival club in the Premier League.
Meanwhile, Bayern Munich midfielder Arturo Vidal has urged his compatriot to join him at the Allianz Arena.
"We'll see if Alexis is coming. I do not know yet," Vidal told Bild last week. "I know him very well. He is a spectacular player. And with him, we would surely improve.
"We already have a lot of top-level players. We are the best club in the world."