Regardless of the origin of the behavior the prescription is more or less the same. You need a good counter conditioning training plan to fix it.
If he is fine out in the world and not reactive around strangers on walks there may be an element of territoriality involved rather than nerves or what have you. It's got to be counter conditioned because the behavior with the barking and lunging is self reinforcing to the point of addiction. Dog sees trigger there's a rush of adrenaline dog gets excited dog gets reactive trigger leaves dog declares victory and a rush of endorphins for the success hits him...the trick is to break that cycle before it starts.