In optocuplers connecting anything to the "secondary" does not affect the "primary" .. It is not a transformer, after all ..
However, ..
In theory the mains should look like a sine wave ..
In practice, it may not ..
Try to add a 270Ω resistor in series with the input ..
The 270Ω, ¼-watt resistor serves three purposes. The first is to act as a fuse should the capacitor fail. The second is to cater for harmonics and other imperfections of the mains waveform that are prevalent on modern-day mains supplies. The third is to buffer the LED against transients and the like. The value is chosen using the R=P/I² i.e. 0.25W/(30mA)² = 277.7Ω (closest available is 270Ω) ..
Regards,
IanP