So I was on a hill doing long range landscapes, miles away. I notice that the shots are specifically less sharp and noiser if I'm aiming at a city, but if I aim at the body of water in front of it or to the right, it is sharper. I assume that this is due to atmospheric haze as the sharpness varies overtime to some extent, assuming same settings and same lightning conditions.
Is there any tool or method to specifically fix it? More so if I have multiple images, can I stack them and get the average or is that not viable?
Talking about taking the shot, a polarizing filter makes quite a difference. There are also specific haze filters to reduce haze without polarizing but in practice, a polarizer is more effective.
Stacking is unlikely to remove the haze but there are tools specifically to reduce haze on taken photos. DxO Optics has their ClearView tool and Autopano Giga comes with a Neutralhazer Photoshop plugin. Generic tools in Lightroom such as Contrast and Clarity can help too.
You're dealing with two separate optical problems.
Haze is caused by chemical compounds in the atmosphere that reflect UV light. These chemical may be either natural or manmade.
Atmospheric turbulence is caused by heat sources and the resulting differences in temperature of different areas of air in the optical path. These heat sources may also be either natural or manmade.
Sometimes the same source can contribute to both haze and atmospheric turbulence. A large city is a case in point. Fumes from the burning of fossil fuels to provide transportation and power release heat into the air and also contain chemicals that cause haze. Many of the manufacturing processes that occur in cities also release such chemical compounds into the air. The structures, roadways, and parking lots of cities absorb heat from the sun and radiate it back into the atmosphere more efficiently than most natural terrain does. Different manmade structures also vary from each other with regard to how much heat they absorb and the rate at which they radiate that heat back into the air.
There are also natural sources that can contribute to both haze and atmospheric turbulence. A volcanic eruption or a forest fire started by lightning would be among such natural occurrences that contribute both haze and heat into the atmosphere.
But there are also cases where thermal turbulence can be caused by sources that don't also add haze to the air of a particular area. Mountain ranges with large areas of exposed rock above the tree line can be thermal hot spots. So can areas of sand with little or no vegetation. There are also natural processes that can produce haze without a lot of thermal variation. The haze produced by the thick vegetation in the Great Smoky Mountains of the southeastern United States is one example.
Dealing with haze and thermal atmospheric distortion require different methods.
If stacking is done with an algorithm that discards the 'flyers' (those samples with the most variation from the median of all of the samples) in the group at each specific pixel location it can help to reduce the effects of distortion caused by thermal effects in the atmosphere. This is often done by amateur astronomers imaging from locations affected by atmospheric turbulence. (Professional observatories tend to be built at locations as far away from atmospheric turbulence as possible: remote mountaintop locations that are also as far as possible from man made sources of light pollution.)
Haze is more related to how specific wavelengths of light influence a photograph. Most of the visible effects of haze are the result of ultraviolet light reflected by the haze. This can cause a reduction in contrast between the darker and brighter areas of a scene. The vast majority of digital cameras have a UV filter (along with an infrared filter) directly in front of the imaging sensor. The effects of haze that are not filtered out by a digital camera's internal UV filter can be dealt with by increasing contrast in the image processing pipeline, whether by adjusting contrast in camera before taking the photo or in post production editing after the fact. Reducing the influence of the bluer wavelengths of light (that are closer to UV than the other end of the visible spectrum) can also reduce the effect of haze. As always, the most can be done when the raw data from the sensor is available for post-processing.