Minecraft wiki entry for Snow_Golem, associated text: Snow golems cannot be made by pistons because the code for generating snow golems are found in the pumpkin’s OnBlockPlace ("placed by a player") event.
Snow golems rarely spawn naturally in snow biomes; if two snow blocks happen to spawn naturally with a patch of pumpkins, a snow golem may spawn naturally.‌[Bedrock Edition only]
They could also spawn in versions prior to 17w47a if a patch of carved pumpkins spawned in a snow biome, or if an enderman placed a carved pumpkin next to two blocks of snow. The chances of this are 1 in 5,000,000,000,000 (one in five trillion).