About MKP Capacitors for Inverter Welding Machine
Don't gamble your life over saving a couple of bucks!

The capacitor that exploded was not any old capacitor -- it is a special "Class Y" capacitor that's designed not to ever fail as a short circuit, which is extremely important because Class Y capacitors are used between things at mains voltage (no touchy!) and things you can touch.  If a regular capacitor like Capacitor 1 was used instead, it could short out when it failed, causing your welder to turn into a people-zapper.  Capacitor 2 appears to be of the correct type (Class Y) and voltage rating, but of the wrong value (270pF?) and probably won't be as effective at its job as the exploded capacitor was.

Get a 10nF, 250VAC Y2 capacitor from a reputable distributor (DigiKey, Mouser, Newark/Farnell, TME, RS/Allied, Future, and Arrow are the ones I know of -- it will not be China-cheap, but penny-wise is pound-foolish with life-safety-critical components like these) and install it in place of the blown-up cap.  (One way to determine if something's a proper safety rated capacitor is to look for test lab marks, such as UL, CSA, or the VDE mark seen on Capacitor 2 in your picture.)