Is an old mtb with replaced gear safe to buy?
With a mountain bike parts do wear out. I would be more cautious of a 10 year old bike with original parts unless it had original tires and I could still see the manufacturer 'tags' (i.e. like new) showing it had been ridden only once or twice and been a garage ornament for all but the first 2 weeks of its life.  

If the bike has been ridden regularly you will be wanting a well maintained one. This means parts replaced as they wear out or get damaged.  

I have bough several second hand MTB's - you get a better bike for you money than new. The ones I have always ended up buying have had many parts replaced, as its these bikes that the riders are using regularity and keeping well tuned and maintained.  

With respect to the edits - a leaking front fork could simply need a new seal or it could be a new fork - its a deal breaker for me.