Some places, online (few because they can't easily check) and local stores, may sale only to licensed amateur operators and some don't care. It is a business' right in most places that I know of to chose whom they can and can not sell to. I believe back in the day, Radio Shack (at some stores at least), had a policy to check for a license but they also had a catalog and as long as they got their money, they'd sell to anyone.
With that said, most places will sell it to you. Anyone that knows anything about ham radio will think twice about operating on ham bands without an authorized callsign. A compromised callsign (imposter) or someone operating without a callsign often will be easily caught, at least on the airwaves. If they continue to use their station it is very easy to track down the offender. Ham radio fox hunts are really good at teaching you how that activity works.
It is legal for you to listen in on ham radio without any kind of license on ham equipment that is capable of receiving or transmitting, a scanner, or some other radio equipment (commercial radios, etc) that can listen in on those frequencies.
Of course you know this, but to anyone that does not, do not even think about pressing the transmit button until you have acquired your license. I think it is legal even after you have passed your test but that may only be true when moving to a General or Extra class. Save yourself the trouble and get the callsign.