Yes, provided you have the cash or finance. Unlike many other countries, there are currently no laws or regulations in Japan that prohibit or control the purchase of Japanese real estate by foreigners. There are no restrictions over residency or visa status. In fact, you can even buy and own Japanese real estate without ever having visited the country (although it is not recommended to purchase sight unseen).
Your ability to obtain a home loan from a Japanese financial institution, however, will require you to be a resident of Japan with proof of income.
Property titles can be registered to a foreign address so no matter where you reside, you are able to buy and sell land, forestry, homes, apartments, golf courses, private islands, apartments or entire buildings in Japan.
Purchasing and owning real estate in Japan will not make you eligible for a residence permit.
There has been increasing debate over restricting land ownership to foreigners, but these discussions are usually referring to purchasing land in areas that may be of importance to national security. For example, land adjoining military bases, or large tracts of forest that contain natural water sources.