Not really. It is more an issue of lifestyle, than immunity. Africans in tropics generally live on heights(that means wind will blow the moscitoes out of the village), and in rather small communities, far awy from water.
Europeans tried to settle down same way as in Europe, near water, and got hit by moskitoes and low quality of water rather hard.
It is not really about natural immunity, rather than the enviromental gearing, similar to the way how Africans will not know how to settle down in Siberia, due to it`s strong frosts, and lack of knowlege of agriculture in steppes.
Natural (by which we mean acquired through natural selection) genetic immunity to malaria was very important in why Africans were imported on mass to the Caribbean and later to the American South. It was not just 'how the Africans lived'. In the Caribbean, African slaves and European indentured servants were both imported to work on plantations. The European indentured servants were cheaper, had a superior work ethic (I'm not saying Africans are inherently lazy, people work best when motivated and slavery isn't a good motivator) and didn't run away. From a purely economic perspective the slave plantations shouldn't have been able to compete. But the Caribbean is part of the same tropical malaria belt as the slave's west African homeland so they were genetically superior in that environment. The Europeans died, the Africans didn't. That's why the slave trade became economically successful.
Lifestyle knowledge helped the slaves who ran away and went to live in the jungles of Brazil and Haiti, which were similar to their homeland. But on the plantations it was just a matter of biology which had resulted from environment.
The real reason Europeans didn't conquer Africa outside of a few trading posts is probably economics. The Europeans only interest in Africa was not territory, but resources (the main ones being Gold, Ivory and Slaves). Invasions are expensive. There were two ways to get at that Gold. One was to spend a ton of money and lives conquering the territory, then pay people to mine the gold while defending that territory from insurgents. The other is to just trade for it while someone else pays the labour costs. Not invading Africa was just common sense.
The conquest of India was also entirely economically driven. It was undertaken not by a nation state, but by a publicly owned corporation. Much like in Africa, only small areas of land were conquered. The British, French and Portuguese were only taking ports and city states. The British never conquered India as a whole, they controlled India through establishing political hegemony over the 'Princely States' and they were able to do so because the actual rulers of India found that this was (at first) to their economical advantage. The British didn't bring anything new to India. India had been set up for centuries as a land of many small states that could change allegiance between different Empires and survive continuous rise and fall of Empire after Empire. The British just slotted into that system. Their military skill wasn't an inconceivable bolt from the blue that let Britain do something that India had never seen, it just meant that Britain was the latest in a long line of powerful military forces on the continent. So those who were dissatisfied with their current overlord would do what they always did, get the new kid on the block to kill their boss for them and hope they prove to be a more benevolent ruler and if not, they could always get rid of the British in a century or two and replace them with someone else.