Depends on the game. Most games have permanent hardcoded consequences for killing non-hostiles. Some games make it inefficient to kill friendlies by giving them stupid amounts of resistance or giving the action no benefit. Some games you just can't kill friendlies at all.
If I had the opportunity to kill an NPC for some sweet gear that wouldn't lead to a forgeted up playthrough, probably yeah