Translator devices or technology
The language issue in the MCU is mostly explained by the use of translator devices or technology.
For the Guardians of the Galaxy characters, James Gunn, the writer and director of the Guardians of the Galaxy trilogy, confirmed on Twitter that all of the Guardians (except for Groot) have implanted translators. It can be assumed that most of the space-faring characters, like Captain Marvel and the Kree, have similar devices. Captain Marvel explicitly mentions her universal translator in Captain Marvel (2019), when she thinks that the person she is talking to isn’t able to understand her. (Captain Marvel: "Do you understand me? Is my universal translator working?")
As for Thor and the Asgardians, in the comics, there is something called the "Allspeak" or "All-Tongue". This magic or technology is presumably also present in the MCU, serving as the Asgardians’ "universal translator".

Relevant James Gunn tweets (2023-03-26):
Question: James, is it true that all the guardians talk in the language of their planets but manage to understand each other thanks to translators present in their necks?
James Gunn: Yes.
James Gunn: Translators work both ways. All of the Guardians other than Groot have implanted translators. They understand and can be understood by others.
