If your friend visited a foreign country, you could say any of the following.
A. "Was it fun there?" or even better "Did you have fun there?"
B. "How did you like it there?"
Note that it is possible for a person to have fun in a foreign country and not like the country at the same time. They might have had fun meeting their relatives and friends, doing certain activities, or going to some specific places. But they might not have liked the polluted environment, the road congestion, and the high price level.
Hence, if someone says they did not like "Country X", it does not necessarily mean they did not have fun there.
C. "How did you like "Country X"?"
If someone asked me that question, I would most likely start talking about the beauty of the country and the great things about the country. If you want to ask your friend about their daily debauchery, then "Did you have fun?" would be a better choice.
If your foreign friend is visiting your country, you could ask
D. "Do you like it here?" or "How are you liking it here so far?" or "How are you liking Country X so far?" or "What do you think of my country?"
But this to me is very awkward
E. "Is it fun here?"
Instead, you could ask
F. "So, are you having fun yet?"