Her husband used to treat her well and meet all her needs. She has a house that she wants to dedicate for buying Ud-hiyah (sacrificial animal offered by non-pilgrims) for the poor and other charitable matters. She wants to know if she can dedicate the reward of these matters to her dead husband and his dead parents although the latter used to mistreat her
until his death.
It is permissible for the questioner to dedicate the reward of this charitable work to her dead husband and his parents. Having been mistreated by his parents does not prevent this, for Allah Almighty urged for forgiveness in general. Allah (Exalted be He) says,
And to forego (and give her the full Mahr) is nearer to At-Taqwa (piety, righteousness).
He (Exalted be He) also says,
...but whoever forgives and makes reconciliation, his reward is with Allâh.
May Allah grant us success. May peace and blessings be upon our Prophet, his family and Companions.