"Cook off? No- but high temps will cause smokeless powder to degrade, and become less stable, faster, though we are talking about long-term exposure and it wouldnt actually become dangerously unstable for years even so.
A bigger issue is probably humidity seeping into the cartridge cases, contaminating the powder and primers and causing case corrosion. Since rimfire cases are generally not sealed as well as centerfire- and the primers tend to fall apart when subjected to vibration such as road travel- I would surmise that .22LR would be more severely affected.
Now, would I keep surplus WW2 Japanese Nambu ammo in a hot car........uh, no.
Bottom line, its a good idea to rotate any ammo that is regularly exposed to heat and humidity to limit its exposure.
FPNI.
Cars have been monitored and will exceed 160F in worst case conditions. They will kill small children and pets if left inside unattended. As for storage, the real issue is the accumulation of humidity, which will condense on colder metallic objects. That means your cold metal gun parts will get water from the air collecting on them, which includes cartridge cases made of metal. Including the one in the chamber. That water will creep between the case and chamber wall, and because of the imbalance of electrical charge set up electrolytic corrosion. You could just as easily dip the gun in water once a week and leave it in the trunk to dry out.
Polymer won't, altho 160F and long term exposure will cause deformation of fiberglass reinforced nylon, and those of us who remember the black toolboxes in pickup trucks thru the 80's also remember them bowing under the weight of tools when left out in summer temps. A lot got propped up with concrete blocks, seemed to be about the right height. Along with the heat problem was the gasketing to keep out water, which always fails as the box settles, and it allows humid air to infiltrate, getting tools soaking wet and even pooling up in the bottom. Worst cases I've seen are 4-6 inches of water sloshing around. Trunks, too.
But, it's ok to keep a gun in there. And guns have ammo. It's a recipe for disaster. And we haven't even addressed how many guns are stolen from parked cars, many times right in front of a home. Yet we ridicule the idea that stolen guns are what are sold in Detroit and keeping the murder rate so high, yet organize and debate why law enforcement shouldn't trace stolen guns and penalize the insecure and lazy storage.
Guns in cars corrode, rust, cartridges fail, and they get stolen which supports crime and murder. Not much good to the owner long term, carry is your better option.