Yes, you can cut your sacrificial anode rod, whether it is magnesium or aluminum, to replace it. To do this, use a pair of gloves and a saw and cut as you remove the old anode. However, when you cut the anode, make sure that the bottom part does not fall into the bottom of the tank, as you will not be able to pull it out.
In confined spaces, cutting the anode rod technique is often used. Make sure to dispose the old anode rod in a safe way and as per your environmental waste regulations in your municipality.
If you don’t have enough space and you are tired of changing the anode rod, you should install a powered anode. Only 12 inches long, this anode is made to last over 20 years.