In a nutshell, Yes. Some questions to ask:
1. How is BAT1 generated? Is it an isolated power supply or literally a battery?
2. How fast do you need the switching to be and at what frequency? The output driver of the optocoupler may not be up to the task. If it is just powering a load then it should be fine.
3. If the duty cycle doesn't have to be 100% and galvanic isolation is not a requirement then high-side floating gate drivers are a better bet with a simple bootstrapped power supply - https://www.infineon.com/dgdl/an-978.pdf?fileId=5546d462533600a40153559f7cf21200
you can use isolated dc-dc converter for driving the high-side mosfet. Here is the link for isolated dc-dc converter: https://www.mouser.in/ProductDetail/Murata-Power-Solutions/CRE1S1212SC?qs=pFP7BvE1Pmz5XALT59wZHw%3D%3D
isolated dc-dc converter will give you isolated VCC and GND . To turn on the mosfet a gate voltage above threshold voltage is required with respect to source terminal.
FUNCTION OF DC-DC CONVERTER: consider that the required voltage to turn on the mosfet with respect to source is 12V. If the source already has 10v(floating),then we have to supply 10+12 =22V to the gate in-order to turn on the mosfet. So DC-DC converter will lift up/adjust the "vcc" according to the GND in the output side.And this supply is given to the driver ic/optocoupler . So output pwm will be swithing with this vcc and ground.