there are different types (features?) of dashcams
Some only record while the engine running - so would need to be hard wired to car to help for this
Cameras either point forwards or backwards - so some people have 2 fitted, the angle of view is wide so you do see cars parking next to you, but they don't look sideways
Cameras usually automatically record events, based on noise or impact - so a door hitting the car may be recorded but its quite a low impact event
Assuming
(i) you have camera working while parked (it needs to be wired in to do so) and
(ii) the person driving in to the space next to you is recorded (so you see the reg number etc) and
(iii) the impact of the door triggers an event so you can see - or you review all the recorded footage yourself
then yes you would be able to "prove" who did it - but I don't know if the police or insurance would do anything