I used to live in Tokyo (and also in Toyama prefecture, which is more remote and rural). I've also cycle-toured in Japan.
It's not exactly true that cycling is allowed anywhere in Japan. It depends on local byelaws. As to how much it happens, well, 'mamachari', that is sit-up-and-beg typs bikes ridden by mums (actually by very large numbers of people) tend to be ridden on the sidewalks, whereas road bikes tend to be ridden on the road. But not always.
The less great side of this largely anarchic world is that quote a lot of older cyclists tend to ride on the road against traffic. This can be remarkably dangerous to other cyclists and to them. And no, this is not legal, nor is cycling the wrong way down one-way streets. It is just that the 'sidewalk' is often largely undifferentiated from the road surface, especially in back streets.
Otherwise bikes are treated just like cars. They don't have priority at junctions etc., but drivers are generally pretty polite to cyclists, and traffic is generally slower in cities, although there is also a lot of really bad driving and mopeds and scooters are particularly poorly ridden and often very dangerous to be around.