So then who is liable if some dangerous substance is discovered within a company's office in Germany? Or if someone gets hurt by a normal object placed in a peculiar position?
There is an investigation (for that we have the police) on how it got there and who is responsible and if something illegal (determined first by the prosecution office and then determined by a court) was going on.
Probably the building is evacuated and the dangerous thing secured by specialists E.g. a bomb squad.
Then the same thing. The police and the prosecution find out if this was illegal, if the possession is illegal, who possesed if and who brought it and why, then who is responsible and a court decides if someone is guilty. The court will decide if the company is responsible E.g. because of negligence, they might not have implemented the law, educated their employees etc. In the case of dynamite that an employee brought, the company is not responsible, there might be terrorism charges against the employee.
Assuming the perpetrator is unknown.