While changes in camera or image compression after training can be severe, if it is the same, the problem is much less. Of course with more noisy images the performance is less, but I never heard that standard JPEG compression would make a big difference. But it will depend on the application.
If you change things after training, it very much depends. E.g. for some networks changing the resolution doesn't work at all. For others its possible. Its very network specific. In general any change (even lens, lighting, background, etc) needs to be evaluated and needs to be included in the training from a theoretical perspective.
In general its not a good idea to have training data that is qualitatively different. If you want to classify PNG and JPG, then it would be best to also train on both. The same for other image properties.
A CNN cannot extrapolate, it usually just works within the training set space. Other models can do that, like rule based models.