Throughout history it is certainly true that Bayern "took" many players from other German clubs, even from rivals and direct competitors such as Gladbach and Kaiserslautern in remote times, Leverkusen and BVB in more recent times for example. Definitely not all but I think it is true most or a big majority of German players would still prefer joining Bayern.
Those who said it is better for German clubs to sell players to foreign clubs than to Bayern are most likely rival team fans who don't want to see Bayern keep dominating Bundesliga and resorting the other clubs to incubators for Bayern. Certainly for the greater good of the league the best players should stay in Germany, I understand, but if I were a rival fan (and I am actually) the most important to me would be not seeing Bayern keep succeeding, from a selfish perspective.
By the way those players that went abroad, I think Bayern never showed any interest on Keita; Dembele wasn't considered probably because they knew he wanted to join us and they didn't want to plucking another player away from BVB having just taken Goetze, Lewandowski and Hummels in the last several years; with Sane they did show some interest as Guardiola wanted him I believe at the time but City was one step ahead of them; the same with KdB who was reportedly saying that he preferred going to Bayern but Bayern was too stingy to match Wolfsburg's asking price so he was plucked away by City too.