"Whose house is this?"
Translation:Чий це дім?
Будинок is a building for living, "house" in its primary meaning. It also can be used to mean any building (but that's usually будівля).
Дім is mainly a place where people live, home. It does not have to be a separate building/house; it may be just a flat or even a room. But it is occasionally used to mean house
Is there a difference regarding the pronunciation between дим and дім? I've been wondering about that for a while and don't know any native speakers of Ukrainian.
Have a look at https://en.wikipedia.org/wiki/Ukrainian_phonology, in particular https://en.wikipedia.org/wiki/Close_front_unrounded_vowel for "і" and https://en.wikipedia.org/wiki/Near-close_front_unrounded_vowel for "и"