The discovery of terrestrial exoplanets orbiting in habitable zones around nearby stars has been one of the significant developments in modern astronomy. More than a dozen such planets, like Proxima Centauri b and TRAPPIST-1 e, are in close-in configurations and their proximity to the host star makes them highly sensitive to stellar activity. Episodic events such as flares have the potential to cause severe damage to close-in planets, adversely impacting their habitability. Flares on fast rotating young M stars occur up to 100 times more frequently than on G-type stars which makes their planets even more susceptible to stellar activity. Stellar Energetic Particles (SEPs) emanating from Stellar Proton Events (SPEs) cause atmospheric damage (erosion and photochemical changes), and produce secondary particles, which in turn results in enhanced radiation dosage on planetary surfaces. We explore the role of SPEs and planetary factors in determining planetary surface radiation doses. These factors include SPE fluence and spectra, and planetary column density and magnetic field strength. Taking particle spectra from 70 major solar events (observed between 1956 and 2012) as proxy, we use the GEANT4 Monte Carlo model to simulate SPE interactions with exoplanetary atmospheres, and we compute surface radiation dose. We demonstrate that in addition to fluence, SPE spectrum is also a crucial factor in determining the surface radiation dose. We discuss the implications of these findings in constraining the habitability of terrestrial exoplanets.