Isolation is usually the best policy. But sometimes isolation is not possible, or cost effective or...

In this case, ERMEGM (I hope that is an acronym for something!), has the grounds connected. In this case, if you added an opto, you would have both the Emitter and the LED Cathode connected to the processor GND. You would have some sort of resistor in series with the LED anode. The collector would be connected to VCC through a resistor.

Now, apply 12V to the LED through the resistor. The transistor will conduct, and the PIC pin will go to GND. Take away the 12V, and the PIC pin will go to Vcc - no higher. So far, so good.
If there is noise on the input, the opto (because it is slow), will not respond to really narrow 'glitches'. That is good, too.
A downside is that the LED has virtually no hysteresis. There will be very little noise immunity if the signal sits around some value
above the LED threshold (exact value determined by the resistor value).
If you apply a narrow 20KV spike to the Anode of the opto, you might probably blow everything - because most optos don't have an isolation voltage of greater than 5KV.
If you should accidently apply 50V continuously, you might burn the resistor in series with the LED, since the value of the resistor will have to be low enough to give it a few mA of drive at 12V.

On the other hand, if you use a divider you have the hysteresis of the PIC input pin. If you add a capacitor across the "lower" resistor, you block any narrow spikes, and you have noise immunity. Amazingly enough, this will also protect the PIC from those narrow
20KV spikes. How do I know? I have tested them. And if you should accidentally apply 50V continuously across the resistor network (7.5K/5K like I suggested), then you would have 44.5V across the "top" resistor (because the PIC would clamp at Vcc + 1 diode drop). I = E/R, so the current through the resistor would be ~7mA (6mA into the PIC pin and 1mA through the "bottom" resistor. Will the PIC care? The datasheet says it won't. A PIC input is good for at least 25mA in the "clamp" mode. No damage would result.

I'd say that this is a case where a divider is probably as good as anything.