We’ll…
I’ve bought keys at Ace hardware for my ford, I did however have to program the key myself, super easy on ford, I can’t speak for all makes and models, a quick online search should tell you if and how to program your own keys, this was sometime ago, I think the key was $40 or so at ford (unprogrammed) and ace was half that, you should be able to get them online just the same probably cheaper if you’re not in a hurry. There are however istances when you could be stuck and have to deal with the dealership, prepare yourself 
Unless you got some really weird high tech key. VW/Audicomes to mind they make some wicked keys I don’t think you can just buy anywhere.