When I was around your age, I too was dared to empty a 2 liter tub of ice cream into my briefs and keep it in for as long as possible. I'm 53 now and I want to warn you now that this isn't going to end well for you...
No, it won't shrink your testicles and won't prevent the onset of puberty. It will be much, much worse.
After the first year or so, by the time the ice cream had really had time to work its way both into the fabric of my tighty whiteys and deep into the skin around my entire groin area, I began to notice that my underpants and skin were fusing together. It became harder and harder to distinguish where boxers ended and groin began. The ice cream that hadn't melted had over time hardened and this, combined with the melding of fabric and skin soon enough meant that I was never able to remove those undershorts again. I became one with my Y-fronts.
By around the 5th year, the ice cream had fully petrified and by that point, any attempt to remove the pants would have meant ripping away half my body along with them so it just wasn't an option. I had to resign myself now to a life of solitary sexless existence. No girl in her right mind would ever go for a guy with a petrified ice cream groin and without a hammer and chisel or a drill of some kind, there was no way she would ever be able to find my penis, long forgotten and by now completely inaccessible.
Now, nearly 40 years later, I look back at the day I was dared to do it and wonder how things would have been different had I only declined the dare. Sadly for me, it's much too late but for you, there's still a chance.... don't do it, young friend, don't do it!