help connecting Arduino UNO to n-ch MOSFET via Optocoupler

You do draw your schematics in a very odd way.
I would connect those capacitors across the supply not the solenoid.

if I at any time later for any reason wish to use this driver for, example, 12 V motor, the gate voltage will also drop, yes?

Yes.

How are drivers usually designed so that they can be used for as wide voltage range as possible?

They are more complicated with a regulator giving you that extra voltage source you had in the first place.