This is an interesting question. There is no specific evidence in Their Eyes Were Watching God which points to this incident as being an obvious allegory of racism. After rereading the passage, I can make a few observations which might help you make this case; however, the evidence that this is somehow a clear picture of racism is not particularly strong.
Obviously Janie and Tea Cake are black, so anything that happens to them could be seen as an act against all blacks. There is little to support this interpretation throughout the novel, though, as all kinds of things happen to all kinds of blacks. The hurricane does not just displace one group of people, of course, though the migrant blacks are the people we see who have to move.
The rabid dog is standing on the back of the cow, elevated above the pair in the water. Allegorically, this could represent their status as well as the supremacy of the "animal" called racism.
Tea Cake is determined to save Janie and attacks the dog to save her life. He seized the powerful dog around the neck in an attempt to kill it; however, he was weary and could not "kill it with one stroke as he had intended."
Neither man nor animal could defeat the other, so they battled on until the dog managed to bite Tea Cake one last time. Apparently that was enough, for Tea Cake then
finished him and sent him to the bottom to stay there.
If this incident depicts racism as the dog, we understand that to mean that racism is a disease, that it bites (harms) people, that a battle must be fought to win it--all of which might work as an allegory. The final statement, where the dog is dead, condemned to a watery grave, never to return, is where the analogy or allegory falls apart the most. Racism--while certainly not as horrible, prevalent, and tolerated as it once was--is not dead.
There is a kind of allegory in this episode, though it is clearly not an exact analogy to racism.