In case that wasn't clear: don't do this. Never change colours in a logo of a third party yourself.
Any good logo has alternatives with less or secondary colours, or even a negative (light for on dark background). Use that. As Billy Kerr suggests, many big companies have dedicated download packs with all kinds of alternatives for you to use. They usually don't take kindly to you not following those guidelines and versions.
The only exception I could think of is the use of social media icons, and even that is a grey area. Even those companies would rather have you not use re-coloured versions of their logos, but these are ignored so commonly, that, at least in my mind, it's at least somewhat okay.
Should an identity not have such alternatives, making the logo completely white or completely black is a somewhat less correct but acceptable compromise. In this case, contacting their marketing department might be a good idea.