か and っていうの are different topics.
The sentence in question is roughly the same as the following:
I'm asking ⸨why Japanese people wear masks⸩.
This か is a question marker, and 日本人はなぜマスクをしているのか is a type of noun clause called an embedded question (marked with
⸨⸩). Here, this embedded question is serving as the object of 聞く.
Your question has っていうの, which is a colloquial variant of というの. って/と is a quotative particle, いう is basically "to say/call", and の is a noun menaing "(some)thing". So the literal translation of Xっていうの/Xというの is "something (people) say/call X". You may know this, but this construction is typically used like this:
That he will come is good news.
(The thing we call) hibachi is a kind of heating device.
The primary role of というの is to turn a sentence into a noun, as seen in the first example above. But it can be used after something that is already a noun, as seen in the second example. In such cases, it emphasizes that noun. In your sentence, っていうの is used right after the embedded question (a noun) to emphasize it. It doesn't change the meaning of the sentence drastically, but your sentence would look more natural with っていうの. (By the way, this っていうの is interchangeable with っていうこと and ということ.)
It will vary depending on ⸨what country they are from⸩.
This っていうの is optional because どこの国の人か is already a noun (embedded question), but it's a nice-to-have.