I had a reader question about fan fiction and writing for publication. This is an area that's changed drastically in the past year or so, so it's hard to offer a lot of advice, as it may even change again. But I'll take a stab at it based on what I know at this point.
For those who aren't too familiar with the concept, fan fiction is stories written in other people's universes. It's technically a copyright violation, but most rights holders (authors, publishers, production companies) turn a blind eye to it because it's produced out of love and helps promote the original works. There are a lot of different kinds of fan fiction. It may be stories that continue the adventures of the original story -- the crew of the Enterprise explores more strange new worlds. It may cover scenes we're not likely to see in books or on TV because of the need for conflict or pacing but that fans might be curious about -- the crew of the Enterprise plays poker while talking about their feelings, with no crisis interrupting them. It may focus on a relationship that's different from the original -- Kirk and Spock are in love and romantically involved. It may add a new character who allows the author to play in that universe -- Lt. Swendson, an auburn-haired, green-eyed beauty with brains and a lovely singing voice, joins the crew of the Enterprise, and Will Riker falls in love with her when he hears her singing jazz on the holodeck. It may move the characters into an entirely different situation -- the crew of the Enterprise are on the police force in modern New York City. Or it may explore other areas of that fictional universe -- the adventures of another ship in Starfleet.
Before the Internet, people shared these stories with friends or exchanged mimeographed copies at conventions. Now, there are a variety of archives and other sites where you can post your stories and share them with fans all over the world. There are some fan fiction authors who have a larger readership than many professionally published authors. Once upon a time, fan fiction was kept relatively quiet. Many professional authors had fan fiction in their past, and some professionally published novels may have had their origins in fan fiction before the author adapted them to be original works, but it wasn't something they generally talked openly about. Now, fan fiction has really come to the forefront. There are a number of authors who got the attention of publishers or agents with their huge fan fiction followings, and some of their books originated as popular fan fiction works. I've heard a high-level editor talking about reading fan fiction archives and occasionally contacting an author whose work she liked. Amazon now has a program in which people can self-publish fan fiction written about certain authorized properties, with the author and the owner of the rights sharing in the profits. A bestselling author was interviewed in TV Guide about her basing the characters in her latest novel on characters in a TV show.
Does this mean that writing fan fiction is a good path to writing success? I would probably say no. There have only been a few writers who've translated fan fiction fame into commercial success, out of hundreds of thousands of people writing fan fiction. One or two of them have been able to sustain success, and the jury is still out on the rest of them because we haven't yet seen if they can create anything that didn't start that way. That doesn't mean you shouldn't write fan fiction. If it's true that you have to write a certain number of words before you're able to write something publishable, then some of those words may as well be fan fiction. If you're not likely to be able to publish it anyway, you might as well have fun writing it. A lot of authors I know have written fan fiction or started writing in fan fiction. I dabbled in it when I was in a bad slump after having some novels published. When I was waiting months to get rejections, it was nice to get instant, positive feedback. It allowed me to break out of some writing ruts I'd been in, and I used it as a way to experiment with new techniques. My first attempt at writing first-person narration came in fan fiction.
However, the chances are pretty slim that you'll be able to sell your fan fiction work. There is now the Kindle Worlds program (https://kindleworlds.amazon.com/) in which you can self-publish certain works about authorized properties. Otherwise, if you try to make money on fan fiction, you're likely to hear from a lawyer. Occasionally, an author or a publisher that does the tie-in works for a property may put together an anthology of fan-written works in their universe, with submissions coming through a contest. Unless you're submitting to one of these contests, you shouldn't submit a story set in someone else's universe to a publisher or agent. If it's fan fiction based on a book, no one is going to be interested. If it's a movie or TV series, only one publisher will be authorized to publish tie-in novels, and they usually hand-pick known authors rather than getting works out of the slushpile. An agent isn't going to be interested in a work that could only be considered by one publisher, if at all. The exception might be works based on properties that are out of copyright, like the various books based on Jane Austen's characters. If you're submitting a book that's the continuing adventures of Buffy the Vampire Slayer, you'll just look unprofessional.
The authors who manage to sell their works that originated in fan fiction do so by doing what's often called "filing off the serial numbers." They change enough details that the work is no longer identified with its source -- character names, place names or any unique details. The further the story is from the source to start with, the easier this is. That's why I'm never going to bother reworking any of my fan fiction to sell. I wrote what I called "pseudo canon," so that it read like a lost episode, not doing anything they wouldn't have done on the series, aside from effects budgets and time constraints. It's easier to just write an original novel than to try to change enough to make one of those stories even marginally original. But if you've done something like the crew of the Enterprise as cops in modern-day New York, you may just have to change the names and a few details. Or if you've written about the other ship in Starfleet, you'd have to change enough about the universe to make it no longer the Federation we know. There does seem to be some backlash in the fan fiction community about people pulling stories from online archives, filing off the serial numbers and then getting them published, with some very vocal boycotts of some authors, but those authors are still bestsellers, so it doesn't seem to have hurt.
I suspect there are many more works out there inspired by some other work but that never went through the stage of being fan fiction -- like the author I mentioned who was interviewed in TV Guide. I doubt she ever wrote a story with those two TV characters. She merely wrote a novel whose main characters were inspired by TV characters. I don't know how many paranormal romances or urban fantasies I've read in which the main characters were clearly Buffy and Spike, but with a few details changed. I'm personally of the opinion that if people can tell who your characters are supposed to be, you're doing it wrong, but it these books were published and successful, so perhaps it's a positive if you find an editor who's into those characters.
In general, to sustain a career, you're going to have to make up your own worlds and your own characters rather than using someone else's work as a starting point, and I know of far more authors who, whether or not they'd ever written fan fiction, did start their professional writing careers by writing original works than I know of authors who got published on the basis of fan fiction. If you're getting good responses from your fan fiction, it might be a good idea to come up with something of your own. That way, you've got something you can submit if one of those editors who reads fan fiction archives sends you a message asking if you've got anything they might be able to publish.