I watched this cartoon (or a series of cartoons) as a kid in the 1960s, but I am pretty sure it dated from the 1940s. It involved a modern-day milquetoast who somehow comes to own a hat made from Samson's hair. When he wears it, it gives him Samson's super-strength, and this gets him into all kinds of strange situations; the one I remember best had a giant killer robot with machine guns mounted in its head.
Old cartoon about a modern-day man who gains super-strength by wearing a hat made from Samson's hair
Sounds like Willoughby's Magic Hat.
Willoughby's Magic Hat is a 1943 Phantasies animated short subject directed by Bob Wickersham, produced by Screen Gems, and released to theatres by Columbia Pictures on April 20, 1943.
The short features the character of a diminutive, weak man named Willoughby Wren, who finds he is granted super-strength by wearing a cap woven from the hair of Samson. He then uses his newfound powers to save a young woman from the clutches of an evil Frankenstein's monster-like robot, but finds that his powers vanish when the hat falls off or is removed from his head, which seems to happen often. At these times, the announcer would call to Willoughby, "Willoughby! Willoughby! The hat, Willoughby! The hat!"
It does indeed feature a large robot/tank on caterpillar treads, with machine guns mounted on its 'head'.