And if you wait long enough, it'll lean it's head the other way next! My guess is that the dog is turning its head about a vertical access to get a different perspective for its eyes and different hearing from its ears, an attempt to get as much information as possible to resolve the question. A puzzled or concentrating dog sometimes flares its nostrils too, presumably for the same reason.
One thing almost every dog does when suddenly puzzled or intrigued, is to make a question mark ! It'll stop and raise one front leg and crook it , as though making the shape of an inverted question [interrogation] mark with it. I've got no explanation for that!