Scientists really ought to be looking into this miraculous 'genetic immunity' that pops up in these threads every time smallpox is discussed on this site.
Okay, that was a little overly snide-yes, genetic diversity and gene adaption can help in the face of epidemics, and sub-Saharan Africa has the most genetic diversity among humans (being the founding population and all).
But far more important is, as Dathi Thorfinsson said, that smallpox was already widespread in Africa and possibly originated from that continent. Not only that, but some African societies even practiced variolation!
While there may have been some societies that were isolated form the disease and vulnerable to epidemics, malaria and yellow fever could keep them isolated for longer so that they either did not have to face the disease, or at least could face the disease without fear of occupation, enslavement, and genocide by European invaders (up until a point, obviously).