Yes you can walk into a hotel to get a room. Provided, the hotel finds you fit enough to be allocated a room. Such guests are classified as 'Wal-Ins'.