I did a quick test today with a Meanwell LPF-60D-54, PC817 optocoupler, 10K resistor and a PWM generator. PWM generator + and - were connected to pins 1 and 2 of the optocoupler, and I tested two configurations for the DIM+ and DIM- connections. I didn't use a current limiting resistor for the optocoupler inputs but it would be a good idea. I tested PWM frequency between 75Hz and 1kHz, below 100Hz the lights were flashing and towards the 1kHz, I don't think the PC817 could keep up. I'll stuck with 150Hz for the rest of my tests.
First configuration was DIM+ connected directly to the PC817 collector (4) and DIM- to the PC817 emitter (3). A duty cycle of 100% was the dimmest setting, and 0% was the brightest. I did notice some odd behavior at the dimmest setting using this configuration. The LPF-60D is supposed to dim between 10% and 100%. This was turning the light off completely and I needed to bump the duty cycle up a few % to get it to turn back off. This is the same behavior I see with my potentiometer dimming setup so it might be fine, but this LED driver doesn't have the newer dim-to-off 3-1 so i don't trust that behavior.
For the second configuration, I added a 10K resistor between dim+ and the PC817 cathode, dim- was still connected to the PC817 emitter. With this configuration everything seems to work as described in the datasheet. Same as before 100% is the dimmest, 0% was the brightest, but the light didn't dim-to-off with this setup. From this quick test, I would say a simple optoisolator/optocouple setup with PWM is sufficient for dimming.