It doesn't work like Dune, of course. It's just the consequence of evolution applying to the brain just as much as it does to everything else, producing brain structures that are dedicated to a particular task that happened to be important for the species at some point. If pattern-matching snakes is such a task, I don't see why pattern-matching primate gestures couldn't be one, as well.
Nevertheless I have an off the cuff comment to your question: Dune genetic memory is outside the bounds of our most basic understanding of inheritance because we do not know of any obvious mechanism to encode those memories into gamets in "one shot" (from direct experience to immediate offspring). Compare this with a very long arc over which a gazelle is born with brain initialized so carefully that it can learn to walk instantly, effectively having something that really looks like "genetic memory" of how to walk.
My confused ramblings aside, this to me suggests that it is at least plausible that such commonality among apes and homo exists. Now, providing evidence for it is quite a different ball game ...
So I think your question is where the intelligence came from, and outside of hand-wavy appeals to evolution, I think the simple answer is that nobody knows.