The diagram I marked with yellow and blue shows A at V+ and B at 0V / ground.
If the inputs are reversed, so B at V+ and A at 0V, the upper right diode is forward biased because the transistor base at about 1.2V less than V+ and A is at 0V.
As I just explained above..
It's just the same principle as the lower right diode pulling the base to ground as it is drawn, with B at 0V; the blue line.
Either input can supply power to the emitter via the left side diodes.
Either input can pull the base resistor down via the right side diodes.
It has to have one of each for both power to be available and the transistor to turn on.