ic to drive either one pwm signal or another
There are many ways to achieve this goal. Possibly one of the simplest is to use a SPDT relay. The relay switch contacts would be connected as follows:


NC terminal to the existing uC PWM output.
NO terminal to the ESP8266 PWM output.
COM terminal to the motor controller PWM input.


The relay coil would be connected to a suitable power source and then driven with an NPN or a N-FET transistor. The transistor would be controlled from the ESP8266 PWM selection signal output.