Yes, you can. If you are a citizen of Germany, you can work for any Indian company. You can work for any company in India, provided that it is registered in India and has an office in India.
However, the Indian companies can’t hire you directly. They need to hire a German company, which will hire you.
If you are a German citizen, you can work for any Indian company.