When it comes to second-hand firearms in particular, the rule in this country is pretty much "caveat emptor". If you buy from a gun dealer, some of them are very good about standing behind what they sell. And most would certainly be careful about not selling something that's likely to do damage to the new owner. But if you buy from a private party, the best practice is to take the gun to a knowledgeable gunsmith before you complete the transaction. If not, take it to one afterwards if you have any doubts concerning whether the gun is safe to shoot.