They don't work, and there is some evidence that they in fact enhance the possibility of hitting a deer. Has to do with how sound travels along the roadway in advance of a car. There is a particular circumstance where the reflected sound off of roadside bushlots where there is a fairly solid curtain of trees behind a fenceline back from the highway, causes deer to bolt out onto the highway as they hear the sound coming off the trees. Most of these accidents involve deer grazing in the scrub between the road and the bushlot, and the thinking is that they hear the reflected sound of the car/whistle coming off the trees, and therefore run toward the highway to escape.
I spent a fair bit time some years ago travelling the Blue Ridge parkway in Appalachia by tour bike, and there were a fair number of bike/deer collisions (not pretty) - most of the bikes who hit deer were using whistles. It was uncommon to see a bike without whistles in a deer collision.