How can I put a drain hose through a basement wall or window?
Purely anecdotal, and I'm not claiming it's necessarily correct: When I put in a permanent "exhaust" for my sump pump, I did so essentially the same way the exhaust for my drier vent had been installed: I found an appropriate spot on the outside wall between the basement ceiling rafters, well above the sill and several feet above ground level. I ran a foot-long drill bit through from inside to outside; that gave me alignment marks. I then came at it from both sides with a Forstner bit, using that alignment-mark hole as the centerpoint. I believe I needed an extension on the bit's shaft to reach deep enough to complete the hole. Ran the pipe (with appropriate mounting brackets) from pump to outside, installed the outside bend and the adapter to a flexible hose to route water away from the house, and air-sealed the hole around the penetration.

As with the dryer exhaust, another alternative would have been to sacrifice a pane of a basement window, replacing it with plywood and running the pipe through a hole in that. I didn't like that solution. (The basement gets little enough natural light as it is.)

Note that a dehumidifier doesn't have to drain to outside. Mine drains into the sewer via a hose to the washer's drain pipe. (Actually, in its current location it drains to the same pump that my boiler's condensate drains to, which moves the water to the washer drain, but it comes out to the same thing.) Using the city drains isn't legal for sump pumps in my area, but it's entirely legitimate for the dehumidifier -- just as if the dehumidifier was filling its own tank which you periodically emptied into a sink.