If it's a hole in the magnesium crankcase it can be welded,but not many welders have tried to weld magnesium. As just said the easiest fix is to use a product like JB Weld if the hole isn't too big. Surface must be properly prepared and oil free and the product given time to dry and harden. I prefer a product like Loctite weld which isn't so runny and sets up much faster,but it has been superseeded by another brand name but still commonly available. On one large hole I cut and laid a piece of cardboard over the hole,then trowelled a good heavy layer of the product over it and it held for years..