Some WWII footage for reference:
One of the best sources that I have found so far for food consumption during the war is Lizzie Collingham "The Taste of War: WWII and the Battle for Food" (Penguin Press, 2012). The answer that I give will come mostly from here, as well as from Aaron William Moore, "An Insatiable Parasite: Eating and Drinking in WWII Armies of the Asia-Pacific Theatre (1937-1945)" in Katarzyna J. Cwiertka (ed), Food and War in Mid-Twentieth-Century East Asia (Farnham UK: Ashgate Publishing Limited, 2013), pp. 109-130. While your question is specifically on sailors, ice-cream was a fixation of soldiers across the US military, so I will deal with it broadly. Also, finding info on just sailors is tricky, but as Navy boats during the war were essentially floating military bases, I think the information given can be accepted as applying to sailors.
The American military was by far the best feed fighting force during the war. General George Marshall, the Chief of Staff, was aware that for many American soldiers during the initial stages of the war, there was no strong desire or obligation to serve. This was a result of the isolationist policies of the US government after WWI. Indeed, many soldiers felt that the US government and military had an obligation to them, as they were the ones risking their lives. Therefore, many soldiers expected that they would be treated well by the military for their service. To maintain high levels of morale, US soldiers were plied with a high quality food in massive proportions, including ice cream.
On base or in training, US soldiers were rationed 4,300 calories a day and even more in combat. A large portion of calories came from dairy, including ice cream which was essentially became the default desert item at both lunch and dinner. There was some rationing of ice cream. In Brisbane, Australia, where a large number of US troops were stationed, US soldiers were rationed to 8 ounces of milk/ice-cream per day (already double the Australian civilian ration). However, in reality milk bars often ended up tripling the ration for US GIs and Marines, resulting in widespread dairy shortages for civilians near any US military base or build up(the same issue happened in the States as well).
The availability of ice cream outside of base would have been limited by ration cards: However, flush with cash, many US soldiers would have been able to buy more than their allotment, outbidding civilians. On base, the limiting factor would likely be how much ice-cream was put out by the kitchen each day. If there were 200 sailors on a ship, the kitchen would put out enough serves of ice cream/dairy for 200 sailors. Another limiting factor on ice-cream would have been the size of the main meal. For lunch on a base in Texas, soldiers were given "heart of celery, green olives, head of lettuce, roast turkey and cranberry jam, mashed potatoes, raisin dressing, giblet gravy, buttered jumbo asparagus tips, creamed cauliflower, bread rolls and butter with preserves, lemon custard or ice-cream, washed down with tea or coffee". An army pamphlet given to mothers whose sons were joining the military assured the mothers that the serving generation had grown pup on dairy, and that the boys would be fed according to their mothers expectations. To think that Navy recruits, many of whom were from remote and poor areas of the States, were accustomed to the meal described above is absurd. I don't think many had ever seen so much food at one sitting.
TLDR: There wasn't much to stop American soldiers getting ice-cream because the military requisitioned huge amounts of dairy from civilian farms and cities, and the Chief of Staff realised that the military could gain compliance with food.
In a practical sense there are lots of easy ways to limit how much is served out, the first of which you see in the video. That being dont let the men serve themselves but have men assigned to the Commissary related rates serve it in the Mess, or Stewards to serve the Wardroom. And if somebody is really acting the fool then there is always the option to call over a Chief and see what he has to say about it. Officers could realistically expect to be a bit freer in their consumption, being served by Stewards.
The other practical restriction would be to only man it during certain meals, namely for dinner. Meaning men who were on watch and might miss it and be stuck with Midrats couldnt get any, but also that men could gorge themselves all day either when not on watch or in their workspace or on some work detail.
The final one would be simply hording supply. While many ships could and did make their own supplies, it also wasnt not universally the case. Smaller surface combatants like destroyers for the USN usually did without it due to space and storage concerns. So if only a few gallons are present then it would either need to be eaten quickly if it couldnt be frozen or hoarded to last a while. Though rarely so sharply rationed as in the famous Strawberries scene from The Caine Mutiny
That could lead to some competitions as well, especially on long cruises. Traditionally when a destroyer returned a downed aviator to the carrier they would be rewarded with a few gallons of ice cream in return. So when a plane ditched it was often a mad dash between the plane guard ships to reach them first.
And while ship's stores would offer additional treats and candy to the crew to spend their pay on, nothing I have read ever says that those ships with ice cream or soda bars did not include them as a normal part of the mess for the men. In the end if a man really had the time and inclination they could very likely get themselves a few extra serving beyond any normal calls for seconds if offered. But there would always be a higher authority present if someone took exception and by limiting who was serving the food, and when it was served you could keep a lid on things.