There is nothing wrong with purchasing used firearms, there are some general rules that will help to avoid a bad situation though.
Many gun shops buy and sell used firearms on a regular basis.
Not all gun shops have the time or location to go and test fire every used gun they bring in so it’s a good idea to be careful when purchasing any firearm used.
It is a good idea to carefully inspect the firearm and make sure that the fire control group is functioning and resetting properly.
It is highly recommended to ask, and as long as the clerk gives permission, it would be beneficial to do a quick field strip to look for any unusual or extreme wear on any of the internal parts.
Another great recommendation would be to also ask the clerk if you are able to return the firearm or trade it for another firearm in case you do purchase it and take it to the range and subsequently find out about any major issues.
If the clerk tells you that you would be able to, I would advise that you get it in writing just to cover yourself in a “worst-case scenario”.
If the clerk informs you that returning or trading it would not be an option, I would recommend not purchasing that firearm as you would be stuck with it even if it had catastrophic issues from a previous owner.
As always, make sure to function test any firearm you purchase before carrying it for personal protection.
The time to find out about any issues with the firearm is at the range, not in a situation where you are relying on that firearm to defend your life.