Not only is it possible, it is the fundamental invention of effective "air conditioning"
Historically, an "air conditioner" was an invention that controlled the humidity of air. There were already coolers and heaters, but having the wrong humidity has the specific bad effect of making paper curl.
The first effective "air conditioner" worked by spraying water through air to reach 100% humidity (evaporative cooling), then cold-coil cooling the air (condensing out the water) to the temperature where the water content was the required value, then heating the air to the required temperature with the required effective Relative Humidity.
The 100% humidity stage cooled the air and gave it a fixed relative humidity, required to give the next two stages a known start point. The cooling and heating stages can be two sides of the same heat exchanger.
The next major invention of Air Conditioning was the invention of a better heat pump (smaller, cheaper, and more effective), but the fundamental invention was the realisation that humidity could be controlled as well as temperature, by using a two-or-three stage process.
Patent: https://patents.google.com/patent/US1085971A/en
One of the major advantages of simple modern residential "air conditioners" is that they don't require water supply and plumbing. And a two-stage process is always more expensive than a single-stage process.
The energy requirement of temperature change and humidity change is the same, regardless of which order you do them in, but the efficiency and cost will be different. I'm not an AC engineer, but I know that some buildings still use humidifiers and dehumidifiers, sometimes both are fitted, and used depending on load and time of year.