Esp8226 with opto mosfet switch LBA110
The max on resistance (35 Ohm) is for the output side. The input characteristic is similar to a diode, you need to use a resistor when driving the input.

It is possible to drive it using a ESP8266 output, since only 2mA is needed for activation (check I(f) in datasheet). The 50mA value is the maximum rating for the input, you should not supply that much current. Your suggested connection diagram is correct. Make sure you use a resistor between 100-1k Ohm.