Do outputs of a country produced outside its borders contribute to its citizens' well-being? For example, a Japanese automobile company of which manufacturing factory located in China. Do the outputs produce from the factory located in China contribute to the well being of the Chinese people or the Japanese people?

Why do outputs of a Japanese company manufactured in China counted in China's GDP instead of being counted as exports from Japan to China?
GDP stands for Gross Domestic Product: this is the amount of activity that happens within the borders of the country itself, irrespective of source.

What you are thinking of is GNP: Gross National Product- which ideally would be the amount of economic activity worldwide attributable to citizens or corporations or the government of a particular country.

Historically, countries liked the idea of GNP and it used to be the 'favoured' way of reporting economic activity. However from a practical perspective as the world has become more and more globalized, it turns out that GDP is easier to estimate and is somewhat more realistic when trying to assess the level of economic activity happening in a geographic area.

Ultimately who cares who owns the factory, the fact that it exists where it is and not somewhere else is a huge boost to the local economy. Many industries have profit margins of 5% or less, guess where much of the expenses are being spent?