It's a Y capacitor.
Yes, it is in the correct place.
It ensures both sides of the DC-DC converter are shorted together at high frequencies.
Without the Y capacitor, high frequencies will be coupled from the switching transistor to the secondary side via the inter-winding capacitance of the transformer.
The downside a small current from the mains can leak across the Y capacitor to the secondary.