Differences in Metallized Polypropylene Film Capacitors
The first thing to realize here is that you are looking at packaging differences. Your red one is a dipped coating applied to the inner capacitor to seal it up. The yellow one is packaged by pushing the internal capacitor into a small plastic &quot;box&quot; and the having some epoxy poured into the open end around the leads to seal it up.
You would need to look at the data sheets for the two parts to see of the performance specifications and ratings are suitable for your application. If they are the same then great from that standpoint. From there it becomes your design choice of what capacitor to use. There will be factors to consider in making that choice including:

Cost per part
PCB footprint area
Part physical size
Method of packaging the parts are shipped in
How parts are handled upon assembly of the board
Packing of adjacent parts on the PCB
And there is also even a small bit of visual appearance you may want for your PCB.