With karma, our non-virtuous acts will always be dependent on oneself to eradicate, since there is no saviour concept in Buddhism. It is not within the power of Buddha to wash away the impurities of others. As such, how do we explain the concept of dedication, in particular, the transfer of merits to other sentient beings?
Buddha stated that those who create the causes are the one who experience the results because the imprint or seed of action has been implanted in their mental continuum, not yours or mine. So if the deceased did not create positive actions while they were alive, we cannot create good karma and transfer/give it to them. However, our prayers and offerings on their behalf can create the circumstances necessary so that a positive action they created can bear fruit.
When a seed is planted in the field, it needs the cooperative conditions of sunlight, water, fertiliser etc to grow. Similarly, a seed or imprint of action a person performed will ripen when all the cooperative conditions are present. If the deceased had done virtuous actions when he was alive, then additional positive merits we create by making offerings, prayers, recite mantras can help them. We dedicate the merits accumulated from these virtuous actions for the benefit of the deceased and this could help his own virtuous seeds to ripen. Though this question is targeting at the deceased, it could apply to living beings too.
(adapted from anwsers by Ven Thubten Chondron)