Towers need to be at 25% health to be attacked by a friendly unit, while most things just requires 50%.
The only other exception is with ally heroes. I forget if there's a health threshold, but no matter how low they are you can't attack them ( and therefore try to go for the deny ) unless they have specific debuffs on them - usually, extremely long or powerful DoTs.
Plus anyone can deny themselves to neutrals. You won't give anyone the kill if you die to a jungle camp, even if they damaged you literally half a second ago.
Also worth noting is that a hero, Lich, has a spell that's flat-out creep denial while giving the experience to his team. You pretty much pick him if you ever want to give a specific lead a signficant exp advantage, since you're flat-out removing one creep of experience for your opponent and splitting it between you and the laner.