Unfortunately, it's not unusual enough. If you're looking for a popular car and the dealer wants to make sure they aren't holding onto inventory without a guarantee for sale, then it's a not completely unreasonable request. You'll want to make sure that the deposit is on credit card, not cash or check, so you can dispute if an issue arises.
Really though, most dealers don't do this, requiring a deposit, pre sale is usually one of those hardball negotiating tactics where the dealer wrangles you into a deal, even if they don't have a good deal to make. Dealers may tell you that you can't get your deposit back, even if they don't have the car you agreed on or the deal they agreed to. You do have a right for your deposit back if you haven't completed the transaction, but it can be difficult if they don't want to give you your money back. The dealer doesn't ever "not know if they have that specific vehicle in stock". The dealer keeps comprehensive searchable records for every vehicle, it's good for sales and it's required for tax records. Even when they didn't use computers for all this, the entire inventory is a log book or phone call away.
In my opinion, I would never exchange anything with the dealer without a car actually attached to the deal. I'd put down a deposit on a car transfer if I were handed a VIN and verified that it had all the exact options that we agreed upon, and even then I'd be very cautious about the condition.