Communism appealed to these Third World countries for two related reasons.
First, it appealed to them because they were poor countries who could reasonably blame their troubles on capitalism. Capitalism had, one could argue, exploited them and used their resources and their labor to make the capitalists rich. In such a situation, an anti-capitalist ideology would sound good.
Second, the capitalists who exploited the Third World countries were the ones who were opposing communism in the Cold War. If a country had once been exploited by Great Britain, for example, it might well want to take the opposite side in the Cold War. This was especially true because the communists had never colonized and exploited any Latin American or African countries.