While you can totally do that, modern zombie stories tend to be metaphors for more abstract issues. Faceless hoards, mindless consumerism, spreading pandemics...
honestly, vampires-as-antagonist and modern zombies hit a lot of the same themes in different ways
But if you're going with "mythologically accurate zombies" then zombies are pretty clearly an allegory for chattel slavery.
Like, stepping lightly a classic type zombie is someone who is poisoned to death or near death by an evil sorcerer who then steals their body and revives them in a fugue state in order to use them as a source of manual labor. The slavery parallels are obvious even before you consider the social and historical context.
...Of course, this is all based on real things. Puffer fix neurotoxin mixed with some psychoactive herbs is the main ingredient in the powder used to "kill" someone in preparation of making them a zombie which both puts the subject into a deathlike state and renders them mentally suggestible. There are people in living memory who've been allegedly subjected to this process. So it's probably less of an allegory and ore people just talking about **** that actually happened.
Though interestingly enough, most cultures do have some conception of an animate corpse that preys on the living. The history I've seen that I like is that in prehistoric society there were incidents of bodies being buried in shallow graves and then later people would find a hand sticking out of the ground, rendered into a clawing or grasping pose by rigor mortis, because of wind erosion or a scavenger trying and failing to dig up the corpse and their imaginations running wild and the idea stuck and was permuted over the millennia as stories changed hands.
Like, think about it: you see the image of a hand bursting out of the ground without context and you immediately know what's up. It's iconic, burned into the collective subconscious