However, if the 5V feed to the opto-coupler should increase (such as it's fed from a different 5V source that goes high), then that voltage will feed through the protection diode in the PIC and increase it's supply rail, possibly to destructive levels. A series resistor limits the current, and prevents this.
...
Particularly if the PIC was running off 3.3V, and the opto fed from 5V
It'll prevent damage, but it's not recommended to (ab)use the ESD protection diodes for this sort of thing.
On more recent devices this can cause a variety of issues, so best to avoid it.