Welcome to the forum. Please give each thread a useful title, using some part of the item you are questioning.
Your sentence is fine, if you start it with a capital letter. It's a bit formal sounding and convoluted.
"Whose dad was the teacher talking to?" is the way it would commonly be asked.
Student or Learner