No, not directly. A 3.5 mm jack carries analog signals; an optical (TOSLINK) port transmits digital light pulses. They are incompatible without conversion.
To connect them, you need a Digital-to-Analog Converter (DAC) with an optical input and 3.5 mm output (or vice versa for the reverse). This adds cost and may affect quality. Better: use a device with matching ports (e.g., 3.5 mm aux, coaxial digital, HDMI ARC).