The answer to your question is no. Let me explain. Because this must sound crazy for most people living in the USA.
First off: comparing our countries regarding firearms/self defense is like comparing apples to oranges. Your constitution gives you the right to keep and bear arms....even to the extent of defending people against a tyrannical government. Our constitution doesn't have anything like that.
Guns in the USA are part of the society. Over here this is not the case. Ask a random individuel about guns and the first thing they say: guns are dangerous, scary, people shouldn't be allowed to own them, should be forbidden etc. People over here now guns from the movies.
By law all firearms are forbidden. There are, however, exemptions: sportsshooting and hunting. For sportshooting you have to join a shootingclub. After 1,5 years membership one can apply for a permit. If you are a hunter you have to pass an hunting exam (mostly about environmental laws) and you must show you have a hunting ground.
The police issues the permit after research and backgroundchecks. If there is the least doubt the request for permit will be denied.
Before issuing the permit the police comes to your home: for a talk and to check if you have a decent gunsafe which must me bolted to the floor or wall. Guns and ammo must be separatly stored. So a loaded gun in the safe is forbidden. Storing guns and ammo outside the gunsafe is also prohibited. These measures are there for several reasons: to prevent misuse of the firearm by others than the permitholder, to prevent accidents, preventing theft, to prevent using it for anything other than sports/hunting. Carry of a firearm in a holster is also prohibited. When going to the range guns and ammo must be transported in a bag of case, unloaded.
The police checks this every once in a while (unannounced). The just show up and ask to come in for a check. If you refuse repeatedly...well chances are they revoke the permit.
So...back to the 'defending/engaging a violent home invader'. You are not able to with a gun; since the gun is not 'bedside table' stored. When waking from that 'bump in the night' getting to the gunsafe in the dark, loading your gun and confront the invader.
I don't know how everything is on your side of our planet. Over here people invest in good locks to discourage burglars/home invaders. Al my windows/doors are made of polymer with steel liners. When I turn a key, it locks or unlocks 3 bolts. Getting in my home without a key is very difficult. So...a burglar looking for a score will probably go for another house which has substandard locks.
I'm a LE for almost 20 years now. From my experience: if there is a burglar/home invader who makes the mistake trying to enter a home when people are present they are very young, stupid and/or unexperienced. They scare away at the first sign of trouble. When there is a true violent home invasion it's most of the time criminals going after criminals...or true 'hero's' going after the elderly.
Most home invasions occur when people are not home. Another reason for the obligation to store your guns in a safe, bolted down.
That being said: using force/violence is only allowed for police. A civilian doesn't have any right by law to use force. If you do, you can appeal a certain law. This law states, simply said, that you had to use force given the circumstances, to prevent harm to oneself, another person or goods. A judge will review the case and will pass judgement if this appeal is just or not.
To give an example: a couple of years ago there was a jewelry store being robbed. The store was owned by a married couple. They were robbed a couple of times. The couple purchased a firearm (illegally) to defend themselves. Which I can fully understand by the way. Then they were being robbed the husband was being injured (shot or stabbed, can't remember) the wife took out the gun they bought and shot and killed one of the robbers. This was an incident which dominated the news for a time. In the end they only got a fine for the possession of an illegal firearm. They were not being found guilty of manslaughter/murder.