The law in the UK permits the use of "reasonable force" in defence of ones person or property.
In extreme cases reasonable force might be considered to include lethal force.

Unfortunatly, the police and the courts often seem to start from the presumption that any force is unreasonable. Especialy if a weapon such as a knife, bat,hammer, or even worse a firearm was used.
In law, a lot depends on the intent of the defender, which is not easily proved in court.
To grab a knife from ones kitchen if frightened by a burglar MIGHT be regarded as reasonable.
To sleep with a knife beside the bed, though not illegal in itself, might be regarded as a sign of intent to kill a thief.
The legal argument against a householder who injured a thief with a weapon kept to hand would be something like
"did you keep a knife beside your bed"
"yes sir"
"why did you keep a knife beside the bed"
"because I feared burglars sir"
"on hearing a sound, did you grab this weapon"
"yes sir, I did"
"so in fact, you planned and prepared to potentialy kill an intruder. This was not an impulsive act in the stress of the moment, but you planned it by keeping a lethal weapon ready for use, against anyone, without any care as to safety of the other party in this tragic incident, who was unarmed, not dangerous and merely wandered in through the door out of curiosity.
As a result of your planned murderous attack, a promising young student lies dead"
"but sir they forced the door and I feared for my safety"
"there is no evidence that they forced the door, the surviving one says they found it forced open by others and came in to check on you, to which you responded with lethal force"

There have been a number of cases in the UK in which householders and business owners have been imprisioned for what some would regards a self defence.
In other cases they have been aquited, but the odds dont look good.