How do PWM AC/DC converters work
These power adapters (there is no battery charging circuit !) are indeed buck converters.

However, due to the high input voltage/output voltage ratio it is more efficient to use a transformer instead of only an inductor. The transformer also gives one additional but crucial benefit: isolation.

The transformer isolates the low voltage output from the mains voltage at the input. You do not what to get an electric shock every time you pick up your phone while it is charging now do you ? That is why isolation is needed. It prevents current "escaping" from the mains and returing to earth through your body.

Some means is needed to monitor the output voltage (often 5V) and adjust the mains-side swithing using a feedback loop. This measuring is where the opto coupler comes in, it feeds back information about the output voltage to the chip. Using an optocoupler means that this is also isolated. In some other designs the feedback is done via the transformer but often this is less accurate than using an optocoupler.

You should not draw any conclusions about the response of your multimeter while it is on VAC. Depending on the implementation of the multimeter's circuits it might display 0 (zero) or anything else. You cannot conclude that the power adapter outputs a square wave just because your multimeter seems to think so. You could use a USB LED light or a LED and a resistor to check if the power adapter really switches on/off all the time.

Depending on the load it might also have a different behavior, your multimeter is a very light load so the power adapter might just switch on/off until a proper load is connected.