Proto-Indo-European *peuǵ- "to prick" became Greek πύξ puks "with the fist" and πυγμή pugmē "fist". Greek Πυγμαῖοι Pugmaioi (borrowed into Latin as Pygmaeī) referred to a legendary race of dwarfs.
The Latin reflex is pugnus "fist" as in pugnacious.
How a word meaning "fist" came to be associated with dwarfs, I'm not sure. Maybe because πυγμή was in Hellenistic Greek a measure of length from the elbow to the knuckles, and this was thought to be the height of the dwarfs.
The etymology of fuck is uncertain, but the OED Online says it is "perhaps" from "an Indo-European root meaning 'to strike'", which would be *peuǵ-.