It helps to read about and learn about people's cultures and histories. If you know something about the reality of someone's life and history, it shows that you care enough to take the time to find out about it. It also gives you background information that will make it easier to ask questions that make sense.
However, you don't have to be an expert on someone's culture to get to know them or to ask questions. People who are, themselves, from a culture are usually the best experts, anyway.