In most of the United States you can. Although if it turns out to be the cops bearing a no-knock warrant fraudulently obtained or even for a completely different address, they'll kill you without even thinking about it.
In the U.S., it would be a foolhardy postman who opened the door to put a package inside. But I'm not advocating shooting blindly at any noise you hear without even checking to see who or what you're shooting at.
I guess he scared him all right.
See, that guy should have been prosecuted. We were always taught that you don't shoot somebody who's actually outside your house, and you definitely don't shoot unknown people through the door.
I remember my second-grade teacher telling us that if you shoot somebody as he's climbing through your window, and he falls outside, you should always drag him inside before you call the cops. But those were simpler times. If you tried that these days, CSI would be all over your ***.