Can we use compressor to pump water and centrifugal pump to compress air? if not why?
You have to consider the terms you have used.
There are a number of types of compressor. They would all pump water if used that way but would not be the best way.
One of the types of compressor is a centrifugal type so yes it will compress air. You would not call it a pump though because it is made to much different specifications than a centrifugal water pump.
Liquid water is incompressible . Feeding liquid water into a piston based compressor can damage the compressor. Some screw type or vane type compressors may be able to pump water for a while, but probably not very efficiently, and this would likely damage the compressor after a relatively short period. I seriously doubt anyone would recommend it. Water can be abrasive and corrosive, and should be pumped in equipment designed for pumping water.
Centrifugal pumps will provide some compression, but if they rely on the flow of water to provide cooling, they will quickly overheat and may seize.