Yes, which is why there aren't a lot of NSFW communities right now.
You can be pretty safe if you ban NSFW and have a good hand in moderation, and most of the time if the feds did come knocking it would probably be just to ask for the user who did post it and to give all information on them.
Users love to complain that there is no NSFW in most places on lemmy but then refuse to accept any of the responsibility of hosting it.