TL;DR: in much of the world fictional child pornography is illegal. In the US, any fictional child pornography that is indistinguishable from factual child pornography, or any child pornography that is obscene under the
Miller test[1] is also illegal.
1: https://en.wikipedia.org/wiki/Miller_test