Great question. This is an area that causes guilt and anxiety for many who want to begin erotic writing.
Almost everyone had their first sexual fantasies before they were sixteen, many even were sexually active. But that doesn’t seem proper to write about.
Ageplay is a perfectly legitimate (and very popular) fantasy, where some consenting adults adopt a mindset that is more juvenile. Erotic stories often use the same approach, exploring reminisces or what-ifs, as adult characters play as being younger, or look back on their own sexual origin stories.
This is fine, as long as you adhere to the golden rule of erotic writing: do not sexualise children. Never describe sexual acts that involve characters who are children.
Of course, spanking fantasies often feature school settings, so I always try to make clear in my stories that the protagonists are young adults, and never minors. This is important to me, because I want my characters to be sexual beings that adult readers can relate to, characters with desires and fantasies of their own. Forcing adult fantasies into juvenile characters feels icky, and to my mind, it’s not just improper, it’s immoral.
There is plenty of scope to write about sexuality without mentioning children. They simply don’t belong in erotic writing. You don’t need them, you can easily tell the story without them, or with older characters.
Writing about sex is a minefield, there’s so many taboos and repressed awkwardnesses. But that shouldn’t deter you. Write as an adult, for other adults, and you’ll stay on the right side of what is proper.