There are machines at every station that will accept your cash or credit card and give you a paper ticket in return. Or give you an Oyster Card, for that matter.
I was trying to take a bus from a regular bus stop around 7 pm. Nearby shops where I could've bought a card were closed by then (in that part of London).