Can I work as a pilot?

Sorry, you can't. The heart conditions for having an ICD, or even the ICD implant itself, will disqualify you from getting a pilot's license. You can find more information in the FAA Guide for Aviation Medical Examinars.