Praise be to Allah.
There is nothing wrong with offering condolences, in fact it is mustahabb, even if the person who died was a sinner who committed suicide etc., just as it is mustahabb to offer condolences to the family of a person who was killed in retaliation (qasaas, i.e., a sentence passed in a sharee’ah court allowing the family of the murder victim to execute the murderer) or as a hadd punishment, such as a married adulterer, or the family of a person who drank himself to death. There is nothing to stop us offering condolences to their families, or making du’aa’ for them and other sinners and asking for forgiveness and mercy for them. They should be washed and prayed for, but not by prominent figures in the Muslim community such as the ruler or qaadi etc. Rather some of the people should pray for them in order to deter others from committing the evil deeds that they did. As for one who dies because of the aggression of another, he has been killed unlawfully, so the funeral prayer should be offered for him and du’aa’ should be made for him, if he was Muslim. The same applies in the case of one who is killed in retaliation (qasaas), as stated above, the funeral prayer should be offered for him and du’aa’ should be made for him, and condolences should be offered to his family, if he was Muslim and there is no reason to assume that he was an apostate. And Allaah is the Source of strength.