Blowing up dams--even if the dam is a military object--is a specifically enumerated war crime under the Geneva Conventions, if attacking that object would cause the release of dangerous forces (specifically: flooding) that attacks or could cause severe losses to the civilian population
It is listed in the same category as a nuclear electrical generating facility for a reason.
Attacking them is a war crime. It implicitly lacks proportionality, and explicitly violates the laws of war.