This is actually an interesting legal edge case. What happens if someone casts an absentee ballot, but then dies before election day? It turns out that it's actually very state-specific. Half of states have no provisions for how such a case is handled. Of those that address it, some explicitly allow the votes to be counted, and some explicitly prohibit these votes to be counted.
It's a pretty interesting bit of legal trivia. The whole principle of absentee ballots is that you are not really casting your vote 'early.' It's not like they publish the results of absentee ballots ahead of time. Really you're effectively saying, "I can't make it on election day." An argument can be made that they shouldn't be counted. Why should someone who happens to get a ballot in early and dies be able to have their vote counted, but someone who was planning to vote on election day, but died in the interim, won't have it counted? On the other hand, a good argument can be made that we shouldn't punish those who plan ahead, and as a general rule we just accept the ballots out of respect for the recently deceased. It's interesting that the states that count them or don't are distributed fairly randomly across regions and the political spectrum; it's not really a partisan thing.
But it is a bit of legal trivial that yes, in some states, the dead are literally allowed to vote under certain very specific circumstances.