FSD is supposed to travel with the car, AS LONG AS (and thats a BIG As long as)
1. The original owner actually paid for it in the first place (some people have FSD enabled on their cars but never paid for it, because their "free trial" never ended. Tesla catches this on ownership transfer, and removes it. Much gnashing of teeth ensue, as the original owner never paid for it, but it was on the car, and the new owner feels entitled to it because it was there.
2. The car never went through Tesla after original sale. If the person you are buying it from is the original owner, then you are golden. If its some third party car dealer (vroom / carvana etc all third party car dealers, as well as "joes exotics"), then you dont know if the car was bought directly from the original owner or if it was bought at auction. If bought at auction, it could have been sent to auction by tesla.
IF both of those are true, then tesla generally removes FSD from cars sold to them. That process can sometimes take a bit, so "joes exotics" (or vroom / carvana) could be selling a car and the person sees FSD on it, assumes it will stay (even if vroom / carvana dont advertise the car having FSD), and the removal catches up with the car.. later.
So, TL ; DR... If buying private party, ask is the person the first owner AND verify they have FSD showing as purchased in their tesla account. You should be good then.
If buying from a third party lot, dont add much value to FSD cause there isnt any way to verify whether it passed through tesla hands or not. Perhaps you could contact tesla with a rep from the third party lot on the phone as well, for tesla to verify status of the car (because they wont talk to anyone about the car except the owner).