Yeah, but when it happens it REALLY shocking, and it makes a great plot twist when done right since you don't expect it to happen. That said it's pretty damn hard to do it right, but I think that I have many times. (Mainly the circumstances have to be believable, and there has to be a realistic motive, stuff like that.) I never have any violence or adult themes in general for shock value though, because I'm against that. It's always there to add to the story.
Actually, aside from any protagonists dying, I also tend to kill off supporting characters a lot.