Yes. However, in the absence of any other context there is some uncertainty about whether "him" refers to the dog or, say, the dog's owner. Assuming you mean the dog's suffering, it may be clearer to say "I thought I'd shorten the dog's suffering and put him to sleep."