The plain and simple answer is you really won't have any idea, unless you know the previous owner who actually smoked the pipe and can ask them.
That said, I've purchased many estate pipes, and only once did I have a 'ghost' of some one else's smoking habits that couldn't be over come. There are some mixtures which forever flavor a pipe, but they are pretty rare.
I generally used the 'salt and alcohol' method of treating estate pipes which is as follows:
Just enough coarse grained salt to fill the tobacco chamber.
Pour in just enough alcohol (I generally use Everclear, although any high octane alcohol such as 151 Rum will do) to cover the salt (be careful not to spill any on finished surfaces of the pipe as is can ruin the finish)
Let the pipe sit for several days, the salt will slowly turn brownish in color and develop a surface 'crust'
Once the surface has completely 'crusted over' the process is done, gently break the crust, pout the contents out into the trash or toilet, wipe out the tobacco chamber, run a few pipe cleaners through the pipe and set it aside a couple days to air dry.
Generally, that process works well for all but the most haunted of pipes, in which case you might wish to consider the services of several fine gentlemen for a more professional pipe cleaning.