Hello,
It is more appropriate to present the question separately:
Is there an obligation to save a convicted terrorist?
This should be considered independently of the question of saving a dog.
It seems that the halachic position is that even if the terrorist has been sentenced to death, it is the duty of the court or the competent government authority to execute the sentence. However, as long as this has not been carried out, he is still regarded as a human being. This is not because of his actions, as he has acted against the divine image within him, but rather from a fundamental perspective that every person is created in the image of God.
Therefore, he should be saved, and afterward, he should continue to be punished according to law and justice.
All the best,
Yuval Cherlow
Rabbi Cherlow is the Head of Ethics at the Tzohar Rabbinical Organization.