Such a proposal has been considered. A laser would deliver heat to the surface of a cometary body and evaporate it to produce a jet. Over time, this might be able to provide enough thrust to affect the comet's orbit. It would not work as well with a solid, rocky body because the power delivered to the surface would be insufficient to vaporize solid rock. Comets are mostly ice, so they would be a bit more effective. The problem is that we would not know the composition of the body until rather late in the game. Lasers would not be as versatile as a rocket tipped with a nuclear or conventional bomb. Also, the laser would have to be operated from space and be more powerful than anything we currently have.