It is risky for a noncitizen who has voted unlawfully to apply for naturalization, unless they have a defense under McDonald v. Gonzales, 400 F.3d 684 (9th Cir. 2005), but proving something was not willful can be difficult.
Cancellation of removal is possible to avoid the unlawful voting ground of deportation, but the immigration court might deny it in the exercise of discretion. Illegal voting is not only a Good Moral Character issue. While the passage of time may take the unlawful voting and the making of a false statement under 8 CFR 316.10(b)(2)(vi) outside the period for which good moral character must be shown to naturalize, the noncitizen is still subject to deportation under INA 237(a)(6), 8 U.S.C. 1227(a)(6). The trend in adjudications on false claims and illegal voting has gotten tougher in the last five years, and ICE rarely exercises prosecutorial discretion in favor of the noncitizen. Thanks to D. Jackson Chaney.