Yes, under german tax law, a startup's legal fees are usually tax deductible as a business expense if the legal advice was provided in the "business interest". But shareholders can also usually deduct legal fees for tax purposes if they are related to their investment in Germany. Although the deduction cannot be made immediately, it can be made at the latest upon sale/exit. And an employee's legal fees are also deductible as income-related expenses if they are incurred in connection with a matter relating to german employment law.