If they are of the same mass and composition, yes. Comets are typically less dense and mostly ice though, which will burn up faster in the atmosphere. But if a comet is rocky enough, then it will do more damage due to its higher speed.
But isn’t speed even more important than mass when it comes to energy: E = 1/2 mv^2 ?