Perhaps one of the issues with TV is that some people might tune into a show because of a certain character they like, and if you kill them off you could potentially loose audiance, so perhaps that is why they play it safe. Of coure in some shows, anyone can die so why does it work for some shows and not for others?
I would say, on the whole, what you're describing is the way tv studios USED to look at the issue. Whereas now, most shows (not counting those that have almost no potential for danger in the first place) have swung completely in the opposite direction with the idea that killing people off is not only acceptable, but maybe even necessary sometimes.
As for why it might work more for some shows than others (and it certainly is not something that every show ever should be doing), that's simple: some shows are very much about death and danger. How could anyone take the Walking Dead seriously if none of the main characters ever died? Lamest apocalypse ever. Who would really be invested in Game of Thrones if the stakes only really amounted to 'You win or maybe you get randomly exiled to some little fortress somewhere so that you can return triumphantly a few episodes later'?
Ultimately, the possibility of death should be real in any story that involves high risk (including space travel, ie, star trek). But it should only ever become reality when it truly drives the story forward - not just because someone thinks killing characters is the only way to keep people invested in the narrative. For shows like GOT or WD, death IS a major part of what the story is about, and therefore it must be present almost all the time. For star trek, the story has other things that should be focused on, at least most of the time.