Following are the reasons why DC is used in electrolysis:
Electrolysis occurs by deposition of cation on the cathode and anions on the anode.
This is only possible when the polarity of electrodes remains constant throughout the process.
In DC current direction of current always remains the same. So DC is used for electrolysis.
On the other hand, if we use AC then the direction of the current keeps changing and polarity of electrode also keeps changing and there is no permanent positive and negative electrode, which will affect the electrolysis and electrolysis can not be possible.