Can an implanted defibrillator be taken out of the body?

Yes. Yes, and the generator is usually replaced in anticipation of the end of battery life. There are risks. That is only the generator and not the leads. Lead removal has separate and distinct risks.
Yes. All defibrillators (pulse generator, 'the box') can be removed with a minimal surgical incision and risk. The leads ('wires') going to the heart are more riskier to remove. Their tips are screwed into the heart muscle and over time the muscle and the veins through which they travel to the heart, can 'grow' around them. There is a 2% risk of perforation and death. It's technically feasible though.