Of course you can train them out of it, and for the sake of your neighbours, you really must!
Personally, I would go for positive reinforcement rather than a correction collar, but you probably need to set aside a few days to do it, and enlist the help of some friends to act as stooge visitors.
The toy and food thing is really easy. As soon as he barks for food or a toy, it goes back in a cupboard, he gets sent to his bed and you go straight to another room and look busy. When he stops barking, you get it out again, if he barks, the same thing happens.
You have to repeat this until you can take it out of the cupboard and he doesn't bark. Then reward and fuss. Ideally, you want to try this a couple of times a day on consecutive days until it stops.
Because at the moment, he thinks he has trained you to feed him or throw his ball on his command...
Stopping barking at visitors is harder, but can be done...
Step one would be finding a distraction toy or treat that he really likes.
I would split it into two parts. If he already barks on command, you now need him to stop barking on command. Let's say that command is 'zip it' (avoid 'shhh' if you say it a lot around the house to DCs etc, as it will confuse him to hear that when he isn't barking'.
Get him to bark, then give the command Zip It. Then show the toy/treat and as SOON as there is any pause in the barking, reward and praise. Repeat 5 times.
Step 2 is desensitising to the trigger of noise outside or someone coming to the door.
You need to get a friend to be your stooge visitor/trigger while you are inside with him.
So you get prepared with treats and the toy, and then text your friend to approach the house.
When he starts barking, you distract distract distract with treats and toy. Your friend must be primed to back off as soon as the dog barks.
The repeat again. Friend makes a small noise, you distract with the treat, lots of praise when he doesn't bark.
The friend needs to get closer and closer, up to the point of knocking on the door.
You now need to decide if you still want a guard dog 2 barks at the door, or nothing.
If you want nothing, then you need to carry on with the above. If you want a guard dog who will give 2 barks and then silence, this is when you use the zip it command.
You'll probably have to work your way down from lots of barking to a few barks, but the process is the same - zip it, and as soon as he is quiet, he gets the treat and praise.
Whatever the other triggers are, post, cars starting, you just do the same. Get someone to recreate it, while you distract and reward.
Yes, it is going to take several weeks or mor to sort it, but you've let the dog train you into getting rewards for his current barking so it would be deeply unfair to now use a correction collar. It will really confuse him, because up until now, he has been getting the exact reaction he expected from you when he barks. You need to train him out of those habits while training the new ones in. You don't need to make him wonder why doing his normal behaviour is hurting him.
By training him to zip it, you'll be able to control it very well g in the future, especially in strange surroundings like other peoples homes or hotels.
Feel free to PM me if you need more info - I've had to rush this a bit so will probably spot lots of typos and omissions when I read it back