Yes, you can do it for them. According to Buddhism, anyone who is dead, and who has not yet reached full enlightenment, is already reborn somewhere in another body. Since we don't know that as a fact, then I suggest that we add a little phrase to the beginning of the wish. Keep the wish exactly the same, but add a little phrase at the beginning. The phrase that I use is: "If rebirth is true, may so-and-so, and on and on..." So it is just adding that little bit of "If rebirth is true" and then you give exactly the same wish to anybody who is dead.