On Youtube I have seen a lot of videos like this with car accidents in Russia recorded by in-car cameras (dashcams). Is it legal to use such a device in Germany? If an accident happens, can I use the video as a proof?
This device is legal as long as you do not publish the video. In case you want to, you need to pixelate license plates and faces. Also you are not allowed to have a specific person "in focus", meaning: You are not allowed to sit in the car and point it at specific people. Regarding your comment, having a camera in there that does not record is perfectly fine, no need to remove it.
You can present the camera in Germany in case there is an accident but the validity of the video as a proof has to be decided by the judge. So while there is no guarantee, the chances are high of course that this will help you a lot.
Be careful though: If the police takes the camera as a proof and finds you crossing red lights earlier in the video, they can take that as a proof to get you in return.