Not sure about how far in advance. Worth interrogating the smallprint on the website to see. Yes, you can reapply if rejected. I have multiple friends who did this and got their e-via eventually! Worth noting that as of 30 April,
twenty eight nationalities get a visa exemption (which, in practice, still involves going onto the e-visa system, but less costly and less documents required. A bit like an ESTA for USA!)