I found this circuit that I wanted to quickly implement. He is using an optoisolator and feeding back the output using it. I understand that the optoisolator is isolating the sensitive circuit from noise but if I didn't care about the noise, would the circuit function reasonably if I replace the optoisolator with a large resistor (say 10M)?
No, using a 10MΩ resistor will make the output voltage collapse: The slightest current you draw on the output will cause a big voltage drop across this 10MΩ resistor.
If you're sure the optoisolator only isolates for noise and not for safety, ground loops, etc, you can either directly connect the 5V Square Wave input signal as the output or, when the signal is too weak, replace the whole circuit by a unity gain buffer amplifier.
This optoisolator is a non-linear current attenuator but using a mirrored PD in the feedback loop becomes linearized like a servo.
The voltage input converted to a diode current makes it a voltage controlled current mirror with some 4500 Vrms isolators.
Thus the grounds on either side do not need to be the same and this provides excellent common-mode noise immunity with high voltage isolation and a linear response to 200kHz.
To simulate the circuit with a common ground simply requires you to read the datasheet. If it says 20mA LED current yields 200uA output that’s an attenuation of 100. The voltage depends on the input resistance above 1.2V and output collector load.