It is legal under US law to accept donations without giving anything specific in return. It is also legal to write and publish erotic content, so long as it is not legally obscene (under the Miller test), and does not involve images of actual children. It is even legal to charge for such work (and many do) but the OP does not seem to want to do that.
A comment mentions tax implication, although the question does not ask about them. According to "Do You Have to Pay Income Tax on Crowdfunded Money?" from The Balance, The IRS definition of a gift is:
A gift proceeds from a ‘detached and disinterested generosity,’ and is made ‘out of affection, respect, admiration, charity or like impulses.’" (quoted from Internal Revenue Service. "Number: INFO 2002-0112," Page 3.)
A gift is not taxable income. I gather that creating something, allowing anyone to access it, and asking those who appreciate it to donate is probably not legally income in the US, but I can find no clear statement on the matter. One would do well to consult a tax attorney on the matter if significant funds are derived from such a source. If one provides something of value in direct return for the donation, it is income, as far as I can determine, but again check if it matters to you.
If the sites is created or hosted outside the US, the laws of the countries involved may apply. Sexual content is an issue on which laws vary widely, and what is lawful in one country may be seriously illegal in another.