Your nipple actually does shrink, in a way, but the hair follicles around it stand up and make it erect. This is called “piloerection” and is a survival mechanism meant to keep you warm.
Your penis, on the other hand, has very special mechanisms for heat and cold. Your sexual organs are designed to try their best to regulate their temperature so they do NOT get too hot or too cold—likely because sperm can be killed by these changes. So your penis and testicles will shrink and retreat into your body for warmth. This is the same reason the opposite is true: if you are hot, your penis and testicles will elongate and hang.
In a way, it’s kind of like your nipples are working to keep *you* warm, and your penis is working to keep *itself* warm.
Latest Answers