Is it possible to use capacitor for isolation instead of optocoupler?
A capacitor can be used to block a large DC offset between two circuits, but it cannot be used to isolate two circuits whose reference levels swing widely with respect to each other. The AC voltage difference causes a large AC current to flow through the capacitor.

Have you considered using a pulse transformer instead?