Yes, supreme court justices have died in office, (John Marshall's death in 1835 comes to mind immediately) but there have been many, many others. However, I believe the rules and etiquette of the subreddit requires specific, non-general questions. The reason for this is that with such a general question, it would be impossible to give a run down of them all since it has happened many different times, and all have had drastically different consequences. I might recommend looking up some of the one's who have died and seeing which ones peek your curiosity and perhaps repost this.
edit: Here is a list of Justices who died while holding office.