Your questions are confusing!
You should be more detailed in your story so some can answer the question correctly.
I hate to assume, but since I do not have all the facts I will just have to for now.
He was pulled over, I assume he had been drinking and was driving and was over the legal limit. Since the car was impounded. Yes they can legally search the car. Now if any of the compartments were locked, they would have to attain a search warrant to seach the locked parts. I "asume" the glove bock was not locked. Since they siezed the firearm legally and they have no proof as to who owns the gun, they can and will do a search to see if the firearm is indeed stolen. If the check comes back clean, it is possible that your friend may have to retrieve the firearm. this is a situation nobody should allow themselves to get into. Owning any firearm comes with a lot of responsiblities. If I carry out in public, I always carry with a registered pistol, besides, I don't have any that aren't, they are at the bottom of the sea due to a boating accident in Alaska.