Taxes are due where the business is managed, where the rwvenue is coming from and where tax authorities consider you a company of being a resident. So in your example, the Estonian company will still pay taxes as a German company. Which is explicitly stated in the tax treaty between Estonia and Germany.