Is a solid state relay a substitute for an opto-coupler?

No

Solid State Relay (SSR, abbreviated SSR), is a contactless switch composed of microelectronic circuits, discrete electronic devices, and power electronic power devices. The isolation device is used to realize the isolation of the control side and the load side. The input of the solid state relay with a small control signal, to achieve direct drive high current load.

Electrocoupler is a light-mediated transmission of electrical signals, a kind of electrical an optical an electrical conversion device. It consists of a light source and light receiver two parts. The light source and light receiver assembled in the same closed shell, separated from each other by a transparent insulator. Light source pin for the input, the pin for the output of the light receiver, the common light source for the light-emitting diode, the light receiver for the photosensitive diode, photosensitive transistor and so on.