It will not unduly compromise the galvanic isolation or safety because it is is an XY rated safety capacitor. It's also low capacitance (less than 1 nF) so the impedance at mains frequency is rather high and the resulting current will be low, even if L and N were accidentally reversed and a path was present from -DC OUT to earth.
Although the working voltage rating is only 250VAC it will withstand 4kV to meet the safety agency requirements. Do not substitute another type of capacitor without doing a proper engineering (safety) analysis.
The purpose of C103 is to conduct noise caused by the internal switching back to the input. If you leave C103 out, the output will have high frequency noise on it relative to the input (and thus relative to earth).