I am not registered in the residents’ registry in the Netherlands. Can I buy a house or apartment in this case as well?

Yes, this is also possible. To buy a house or apartment in the Netherlands, one does not need to be registered at the city hall. But you have to be working and obtain income. If you are working in the Eurozone: Germany, Belgium, Ireland (meaning that you get your paycheck in Euro), you can also get a mortgage in the Netherlands.