As a policemen, yes, and if you work in special fields like body guards, but there, you have to go through training and psychological evaluation.
And different to a sword: Nothing, because of that, it is not legal to carry a sword outside of your own home. There, it is okay since it is so large and inpractical that you can't use it that easy. And why that shoudln't be the same with guns? Because when you have a gun, you can shoot a hell lot of people even in the distance, where, with a sword, you have to actually get in close combat, people can easier avoide you than with a gun.
And baseball-bat: Dual use, a baseball bet is used for sports, also, it is more difficult to do kill someone with a baseball bet than a gun. Again, baseball bet demands close combat, also, it is easier to fight against someone with a baseball bet, or to run away from you when you swing it.
And it has nothing to do with being afraid, but with a simple calculation. The weapon-related crimes in Germany are a minor issue, the worst thing you normally see is a knife (again, close combat, with pepper spray to defeat, the wounds can be leathal, but it is rather difficult to do so) because it is pretty difficult to get an illegal gun and even more to carry it around. This is only done for real intense crimes, like during a robery of shops, and even there it is rather rare (of which I was actually once a victim when I worked at a gasstation). There, if the shopkeeper has also a gun,the liklyhood that this ends with all people dead is extreamly high. But in other crimes, it is highly unlikly to ever face a gun, the death-toll of guns are really low - the overall death toll is really low. If we are more liberal with guns, that goes up for all of us.
Also, since germany is quite well populated, police is normally not that far away, so if there is anythign major to happen, they can come and help out.
For further information why the idea of the good guy with a gun can fire horribly back, I would suggest you this nice piece from the US Daily show: