The practice of face mask use in Japan originated from when the Spanish Flu epidemic hit Japan. A decent article on the topic is "Pandemic Influenza in Japan, 1918-19: Mortality Patterns and Official Responses" by Geoffrey W. Rice and Edwina Palmer. To what extent this was a uniquely Japanese affair is hard to say. I'm sure that other states dealing with the pandemic promoted similar behavior, but I can't say for certain. I do think it's fair to assert that public health efforts in Asia, particularly Japan and China, have tended to take on heavily collective and macro-social connotations as part of the state-building efforts. Another good example of this are the Maoist health campaigns in the 1950s to deal with common illnesses like "snail fever or schistosomiasis. A good source for learning about that particular topic is Miriam Gross's Farewell to the God of Plague. There's a broader discussion here about the emphasis on the agency of the individual in maintaining public health as a process of state-building. The practice of donning surgical masks (or cloth equivalents) when ill at work or school was likely adopted during this time. Although, to what extent this strategy was/is effective is hard to say. Other common health practices, like the overwhelming preference for drinking hot water, were promoted during the KMT period. However, the KMT often struggled with maintaining basic public order or curtailing banditry because of the ongoing political schisms within the party, the powerful influence of warlords, and the ongoing Chinese Civil War. So to what extent the public health efforts of the KMT actually influenced the behavior of everyday Chinese is hard to determine. The practice is also popular in Korea, but I can't comment on when the practice became popular or to what extent the Japanese promoted it when they controlled the peninsula.
However, fundamentally I don't think that your question is primarily historical. Much of it has to expectations of people in public, including protecting public health. Furthermore, in China at least people are often expected to go to school or work even if they are sick, in that instance it makes sense to reduce the likelihood that even a common cold will spread. However, u/EnclavedMicrostate is correct here, to a certain extent there is a very "orientalist" knee-jerk curiosity about "harmony" in East Asian societies. This isn't necessarily inaccurate, but it's also not exactly easy to answer "historically." Sociology, psychology, anthropology etc. are generally better means of answering this particularly contemporary question.