They only "contribute" code that requires a Microsoft license to use. Can you use their code without running their VM on their OS? No. Microsoft only releases stuff that require Microsoft products to work (save a few exceptions where it was the company that they acquired that was doing it).
Do I have to run Android to use Google's contributions to the Linux kernel? No. For that reason, I consider Google's contributions a lot more friendly to open source than Microsoft's because they're generally more useful and not limited in usefulness as an express design goal.
I suspect Google, despite having a competing product, has more commits to Firefox than Microsoft does. It's not that Google is a perfect saint, they're not, it's that it illustrates how MS's views on open source differ greatly from everyone else's. Yes, I know that all apparent altruism is a sham and Google is looking out for #1. But there are more positive (and tangible) side effects from Google's apparent altruism than there are from Microsoft's. And since I'm looking out for #1 too, I'm going to pick the products and services that fit my needs best as a developer. That generally means products and services that work well with other products that may or may not be from the same vendor.