Nature of star-forming rings in S0 galaxies