From the Super Mario Wiki
A Freeze Cannon is a machine Wario faced in Wario World. Freeze Cannons appear in the Shivering Mountains level and are black dome shaped machines with a cannon that shoots a freezing stream of ice. Should Wario touch it, he will freeze in place and the player must wiggle the Control Stick to break him free. Freezing does no damage, but it does leave Wario susceptible to attacks from nearby enemies.
Freeze Cannons cannot be defeated. However, Ground Pounding them will temporarily put them out of commission.