In Supernatural season 15 episode 1, Jack's dead body is possessed by the demon Belphegor.
Has this happened before in Supernatural? I didn't think that demons could possess dead bodies.
Both demons and angels can possess a dead body. Though for angels its more unlikely, as they need the permission.
Both angels and demons can inhabit a dead person though given that angels need their vessel's permission, this is likely unique to Castiel as he was resurrected by God in the body of Jimmy Novak while Jimmy was not brought back. Lucifer, after being exorcised from Jefferson Rooney, was sent back into Nick's body by Crowley's perverted spell. While Nick's body had been repaired and improved to act as Lucifer's permanent vessel, Nick did not appear to have reconsented despite having been resurrected. This was presumably due to the nature of the spell modifications Crowley performed.
I am pretty sure that we had seens demons possess dead bodies before, but I can't quite remember and couldn't find any other hint to it.
Yes they can. Remember the Ruby played by Genevieve Padalecki? According to Wikipedia
To appease Sam, who dislikes her using a living host against the host's will, Ruby takes possession of a body recently declared to be dead (Genevieve Cortese).
I'm sure there are other examples too, like Castiel still being able to possess Jimmy Novak's body after it had been destroyed at a molecular level by Lucifer (5.22), the fact being confirmed in season 10. Also, Sam and Dean tried to kill a woman possessed by a demon in season 1 by throwing her out of the window yet she still got up because the demon was still alive in her.