It's hard to compare these two games since they are so different in style and purpose. Ocarina of Time is more story based while Super Mario 64 is more "action" based. They are both excellent games, I give them both a 10.
I'm more of a story person, so I prefer Ocarina of Time.