Yes, you are allowed to film the police. This is a fundamental human right, which Germany has a long history (so far) of respecting. You may not use the pictures you take for commercial purposes, or for the purposes of ridicule or to interfere with their official duties.