Shaikh Ibn Uthaimeen:
Udhiyah on behalf of the dead may be of three types:
1 – When it is offered on their behalf as well as on behalf of the living, such as when a man offers a sacrifice on behalf of himself and the members of his family, and intends thereby both those who are alive and those who are dead. This is permissible.
2 – Offering the sacrifice on behalf of the dead in fulfillment of their last wishes (wasaaya). This is obligatory except in the case of one who is unable to do it.
3 – Offering the sacrifice on behalf of the dead voluntarily and independently of the living – such as offering a separate sacrifice on behalf of one’s father or mother. This is permissible. The Hanbali fuqaha’ have stated that the reward for that will reach the deceased and benefit him, by analogy with giving charity on behalf of the dead.
But we do not think that singling out the dead for offering a sacrifice on their behalf is part of the Sunnah, because the Prophet (peace and blessings of Allaah be upon him) did not offer a sacrifice specifically on behalf of any of his deceased loved ones. He did not offer a sacrifice on behalf of his paternal uncle Hamzah even though he was one of his dearest relatives, or on behalf of his children who died during his lifetime, who were three married daughters and three sons who died in infancy, or on behalf of his wife Khadeejah who was one of his most beloved wives. And it is not narrated that any of his companions offered a sacrifice on behalf of any of their deceased loved ones.
We also think that what some people do, offering a sacrifice on behalf of a deceased loved one in the first year after his or her death, which they call Udhiyat al-Hufrah (the sacrifice of the grave), and they think that no one else can share the reward of it, is wrong – as is offering a voluntary sacrifice on behalf of their deceased loved ones or in accordance with the will, and not offering a sacrifice on behalf of oneself and one’s family, which some people do. If they knew that when a man offers a sacrifice paid for with his own money on behalf of himself and his family, that includes all the members of his family, both living and dead, then they would not do this.