How to program and arduino UNO via NodeMCU ESP8266?
The UNO's USB connection is little more than a USB to UART converter.  The NodeMCU's USB connection is also little more than a USB to UART converter.
With a little jiggery pokery (yes, that's a technical term) you can replace one with the other.
By keeping the NodeMCU in RESET mode (tie the EN pin low, or hold the RESET button) you can use the TX and RX pins as the output to the onboard USB to UART converter to connect to the TX and RX pins of the Arduino.
The tricky part is getting the Arduino to reset at the right time: you have to press the Arduino's RESET button at just the right time. Normally this is done by a small capacitor between the DTR signal of the USB to UART converter and the RESET pin, but you don't have access to the DTR signal, so you will have to do it manually. Timing here is everything. Press upload, and just as AVRDude starts to execute you press RESET. Having verbose compilation turned on in the IDE can help.
It may take a few attempts to get it right.