The tree/humanoid hybrid alien Groot is one of the most popular parts of the Guardians of the Galaxy franchise. This despite the character never saying anything other than 'I am Groot', which is its specie's entire language spectrum. Recently, filmmaker James Gunn explained to fans on Twitter why some people can understand Groot but others can't when he was asked why Star-Lord's universal translator could not decipher Groot's language.
"He doesn't have a universal translator. He has a translator. And it doesn't have all languages in it (it didn't have Sakaaran in the first film for example). And people don't learn Groot through knowing the language - they learn it through connecting with Groot."
This explains why, when the Guardians met for the first time in the original movie, Peter Quill, Gamora, and Drax could not understand Groot's utterances whereas Rocket, who had been working with Groot for a long time, could. By the second film in the series, the Guardians had been a group for a long time, and as a result, we see that all the members could decipher Groot's words.
Unfortunately, the theory gets shot to pieces by Avengers: Infinity War. When Thor meets the Guardians for the first time after crash landing into their ship, he is shown to be able to immediately understand Groot. When pressed for an explanation by the others, Thor explains that he learned to speak the language as an elective back on his homeworld of Asgard.
This means Groot's language can indeed be taught without forming a personal connection. In all likelihood, James Gunn formed the explanation for Groot's language in his own mind while creating the Guardians of the Galaxy series, but neglected to pass on the theory to the writers of Avengers: Infinity War, leading to the Thor/Groot interactions in the movie.
Such kind of minor muddying of the rules of the MCU is inevitable when you have multiple filmmakers and their teams working on different parts of a connected narrative. It is not possible for everyone to be on the same page all the time, leading to parts of the established storyline contradicting what develops in later movies.
Something similar happened to the character of Thanos. In the beginning, he was a shadowy figure operating from behind the scenes, with unclear motivations. In fact, in his very first appearance, at the end of 2012's The Avengers, there was a reference by the Mad Titan's servant to Thanos's desire to 'court death'.
This was a clear reference to the Thanos, who in the comics, wishes to destroy the universe in order to gain favor with Lady Death. By the time Infinity War had come along, however, the character's motivations had changed to wishing to destroy half the population so that the rest of the world could have enough resources.
The mechanics behind Groot's language might be confusing, but the character itself continues to be a huge fan favorite, with Gunn and Groot's voice actor Vin Diesel promising the character will have a major role to play in his franchise in their upcoming film.