It's New York. You can do whatever the hell you want, wearing whatever the hell you want.
However, the sandals with socks will give you away (to the locals, at least) as a tourist. The colorful knit stocking hat could give people the impression that you're a Rasta Man, but might give a flavor of locality rather than foreignness.
Which reminds me, I saw some guy (perhaps a Sikh, or maybe just a wannabe) the other night with his hair wrapped in some sort of cloth and piled up so high on top of his head that he looked (from the rear) like Marge Simpson.
Did I tell the Pinheads about the time 20 years ago when I saw some guy walking through Herald Square wearing fringed leather cowboy chaps? Or the time in the lobby of my very own Lincoln Building where I heard a vaguely familiar metallic jingling in the lobby (which is marble clad and echoes beautifully) and looked toward the source of the sound, where I saw a Nubian gentleman wearing spurs on his way to get an elevator?