Assuming you mean filing a lawsuit for infringement of a US patent, a foreign company can be sued in any federal district court in the US. It is a special case.
IANAL, but they can only sue for infringement that takes place within the US. A German company selling to Indian customers can’t be sued in the US.
But German company selling to US customers can, right? Does that mean the company needs to defend itself on US court?