If you watch Six Feet Under, (SPOILER)the ending is where everyone dies (in flash-forwards, sort of) but it ends the series with this complete feeling, so I think that was done very well.
So, yes, there can be good endings where everyone dies, but it's very rare.