How to drive a high side MOSFET with an optocoupler correctly?
The P Channel MOSFET is mirrored, so the Source looks up, and both
MOSFETS have their body diode pointing upwards. Is this symbol
correct?

Yes.

If the MCU's datasheet lists max 20mA output per output pin, then is
driving by 10mA an acceptable choice, or should I go lower if it is
possible?

It will probably be fine. Just make sure the total current on all I/O pins doesn't exceed the maximum permitted.

The FOD817A datasheet lists information for other versions, and
actually I wanted to use FOD817C: CTR 200–400% (instead of FOD817A:
CTR 80–160% which I guess is on the graph), but I cannot find the CTR
graph for that. How can I deduce that information?

The relative characteristics should be similar, so just multiply CTR by 200/80.

Is -12V a conservative drive voltage, or should I use different
resistors? (Having identical R2 and R3 would make the BOM simpler.)

12 V is plenty. The highest specified Gate drive voltage is 10 V.

Should I follow this advice and calculate with 10mA * 125% * (24V /
5V) = 60mA instead? Or should I use 12V only in the calculation,
because the two resistors halve the voltage at the optocoupler?
(Obviously I want to charge/discharge the gate the fastest possible.)

Not sure what that calculation refers to, but the optocoupler can't handle 60 mA.
Anyway it doesn't matter which calculation you use - it won't charge/discharge the Gate 'the fastest possible', and will be woefully inadequate for accurate PWM at 30 kHz. The optocoupler's inherent delay is 3μs, 9% of the PWM period. The pullup resistance and Gate capacitance will make it worse. With 1k you could be looking at a turn-off delay of 20μs or more.

How to calculate what kind of D1/D2 I need for handling the back EMF?

They should be rated for an 'average forward rectified' current equal to or higher than motor current / 3 if using just high or just low side PWM, or motor current / 6 if alternating high and low side PWM.

Is it possible to eliminate D1/D2 and just use the body diode? (I know
that it is only a parasitic crap diode.)

Yes. You should then factor in the body diode loss when calculating MOSFET power dissipation. At lower PWM ratios This could be much higher than the loss due to RDSon.