A capacitor can be charged with AC but it will be upon reverse polarity discharged, a DC current will charge a capacitor and leave it charged until the voltage is changed. You can charge a capacitor via a diode to not permit it to discharge during the negative portion of the AC cycle, or upon the ceasesing of supply of a DC current. Polarized capacitors can not be charged during the negative portion of the AC cycle, if they are supplied with those voltages the oxide layer and chemistry will fail and the capacitor will become a resistor with a heafty current and likely explode or otherwise fail dramatically.