In The Bacta War , book 4 of the X-Wing series, Rogue Squadron resigns from the Alliance in order to fight against Ysanne Isard who has taken control of Thyferra.
They get their hands on their old ships after Incom offer the Alliance a brand new squadron's worth of X-wings "Someone in the military probably General Cracken, but maybe even Admiral Ackbar decided accepting Incom's gift was appropriate, so all the equipment in Rogue Squadron was inspected, listed as missing parts, and surplussed out.
Winter found out about it before anyone else, and we scooped up the lot, including Emtrey and our astromech droids."
Wedge blinked. "
Surplussed out?
Our stuff was sold as surplus?
" "Broken surplus.
It was missing parts."
"Such as?"
"PL-Is" Wedge frowned. "
PL-Is?
I've never heard of them.
"
Tycho shook his head.
"That's the designation for pilot."
Wedge immediately began laughing.
Someone back on Coruscant favors what we're doing or perhaps just wants to give us the tools to destroy ourselves.
So apparently you can just buy x-wings for cash from military surplus sales.
scifi.stackexchange.com/users/40437/Jontia
In the Legends continuity it seems to be extremely difficult or expensive for private parties to buy a TIE fighter or X-Wing.
In the books, most notably the X-Wing series, most groups not directly affiliated with the Rebellion/Republic or Imperial military relied on ships noted to be cheaper, such as the Z-95 Headhunter.
However, salvaging individual parts of these ships was quite common, as " Uglies " cobbled together from parts of TIE fighters, X-Wings, Y-Wings and the like were used extensively by pirates and mercenary groups.
scifi.stackexchange.com/users/107206/Kyle Doyle
One episode of Rebels (Disney canon) features Mining Guild Tie Fighters .
Because they are not being operated directly by the Empire, they have reduced combat abilities, and are clearly marked with their affiliation.
From what I can tell, it is unspecified how the Mining Guild acquires the Tie Fighters, except that the process is sanctioned by the Empire.
scifi.stackexchange.com/users/68164/Ethan
In the X-Wing novel Mercy Kill , we're shown a used-vehicles lot that specializes in military surplus: This particular lot was thick with decommissioned military vehicles.
Some were early-production-run vehicles that had failed to impress the soldiers testing them....
And then there were starfighters from the orbital base.
Some were old and so worn that their lift wings drooped.
Others, though, belonged to designs that were simply being phased out over time, such as the four classic Incom T-65 X-Wings....
It's mentioned that these vehicles, being destined for civilian ownership, are partially demilitarized; for instance, the X-Wings' proton torpedo launchers had been removed.
There's no mention of the sort of "broken" surplus discussed in @Jontia's answer, but that might simply be a lack of opportunity (it's peacetime, and the local base is small enough that it wouldn't have a constant stream of wrecked materiel from accidents).
scifi.stackexchange.com/users/100151/Cadence
In The Last Jedi , Finn, Rose, and DJ steal an arms dealer's ship.
While talking after making their escape from the casino, they go through the ship's computer and see that the dealer sells ships and weapons to both the First Order and the Resistance.
Presumably, civilians could also buy from such private dealers if they ponied up enough credits.
See this video:
scifi.stackexchange.com/users/106540/Kyle
In a little blue planet known as Earth, bipeds (referred to as 'man') have produced fighter aircraft (not spacecraft).
As time progressed, so did the technology, which created pool of older fighter aircraft that were sold to civilians .
The example shows that approximately 2 'man' lifetimes of productivity (5 million of their so-called 'dollars') could purchase a retired Sukhoi SU-27.
The practice is that original military owners would sell or task the de-militarize equipment to private contractors, who would in turn sell the de-militarized hardware.
It is reasonable to expect that in other galaxies (fictional or real) that a similar eco-system handles the lifecycle of similar military hardware.
scifi.stackexchange.com/users/73347/gatorback
This question  What is the in-universe cost of a TIE fighter?  Establishes that there's a second-hand market for military ships.  Where are these ships available for sale?  Who sells them, what's the main route-to-market (i.e from "in-service" to "out-service")?  Are there any cases in SW literature where a character owns a second-hand fighter (of either denomination)?  I know there are a few questions here, but I assume a good answer will cover the route to market with an example.
How would one buy a used TIE Fighter or X-Wing?
scifi.stackexchange.com
<star-wars>
scifi.stackexchange.com/questions/206388
scifi.stackexchange.com/users/None/
There is no clear and obvious way that people could acquire a TIE fighter or X-wing, although it is believed to be difficult or at least expensive. However, there is some information that suggests that you can simply buy X-wings for cash from military surplus sales. However, there is not enough conclusive evidence for this. There are a number of cases where military surplus lots have fighters and other ships and spare parts that are sold off to interested buyers in a similar way to surplus military equipment on Earth.
The Rogue Squadron in The Bacta War purchased their old x-wings for cash from the Alliance after they are replaced with a new fleet. It is very difficult or expensive to buy a TIE fighter or an X-Wing so groups not affilliated with the major military tend to buy cheaper ships or to cobble ones together from spare parts. In Rebels the Mining Guild has its own TIE fighters although it is not specified how they are acquired. In the novel Mercy Kill thee is a military surplus lot that sells de-militarised vehicles such as X-Wings for civilian use. In The Last Jedi Finn, Rose and DJ steal an arms dealer's ship and find out from its computer that the dealer has been selling both to the First Order and the Resistance so presumably civilians could also purchase them. On Earth you can purchase used Sukhoi SU-27 so why not in Star Wars?