Yes cooking bacon all the way through does kill bacteria that could be in the bacon.
Never eat bacon raw because the bacon could contain bacteria such as botulism that can make you sick and kill you.
Botulism is a very serious health issue so make sure the bacon and other meats you eat are fully cooked to avoid the potential of getting sick.
It does not take very long to cook bacon all the way.
I like to put bacon in the oven and bake the bacon at 350 F for 10 minutes which is enough to cook the bacon all the way.
You can also cook bacon in the microwave as well which takes around 2 minutes as the microwave cooks the bacon faster.
Or you can also cook bacon in a toaster oven or in a skillet.