Basically can engineers design a machine where , while we are freezing and compressing the air for energy storage, we can also purify it of pollutants?
Compressing air (for energy storage or other purposes) heats it up, expansion cools. For energy storage the heat has to be stored, a detailed description can be found here. Cooling air further would require additional energy input - twice, for cooling and then again for reheating upon expansion. Again, see the link for details.
Compression concentrates dust etc (1g dust per 1m³ at 1bar becomes 6g/m³ at 6bar approx). It's certainly viable to have a coarse filter to protect the compressors, then a fine filter for the high pressure air. If this is what you mean by pollutants. This is farily common in compressed air systems for pneumatics: Fine filter and dewatering are installed downstream of the compressors