That should be accepted. "In summer" and "In the summer" are interchangeable, and the same is true of the other names of seasons.
is there a rule which makes us choose the right letter to make preposition? For example: why it is "Nyáron" not "Nyáren"? Thanks in advance
We have deep-class vowels (a, á, o, ó, u, ú), and high-class vowels (e, é, i, í, ö, ő, ü, ű). Nyár is a deep word, so we use the deep -on. But tél is a high word, so we use the high -en. Nyáron, télen, asztalon, széken, ágyon, polcon, fogason... And just to complicate this, ö/ő is also high, but we also have -ön, for example tökön, ördögön, bőrön, etc.
Just to add to this (correct) answer: slightly more useful terminology might be front vowels (e, é, i, í, ö, ő, ü, ű) and back vowels (a, á, o, ó, u, ú). The terms front and back refer to the position of the tongue while making those vowels.