Increased melanin provides some protection against burns, but it doesn’t make you immune. There’s also the aspect of UV damage without burns, which is still harmful and is not affected by melanin levels.
melanin is also not the only factor in preventing sunburn/cancer. there are many repair pathways and genes, which are present to differing levels in various populations.