If you use an arc (stick) welder with nickel rods and, arguably most importantly, preheat and a slow cooldown in hot sand (a BBQ comes in handy for DIY'ing it), it's usually possible to do it and get good, lasting results, but it's entirely dependant on the cast iron needing repair. Some (Usually very old) cast/pig iron is simply not weldable.