Actually nuclear submarines already make their own oxygen with electrolysis so they don't ever need to (nor do they) surface, except to exchange personnel or to load additional food.
Of course, they also need separate CO2 scrubbers to keep the air breathable, which consume a lot of power, use caustic and hazardous chemicals, and make the whole ship smell pretty bad.
An artificial leaf that removed CO2 without these downsides might justify a refit.