Call node information when rendering links
Assuming that you need to access to $node to populate the preview:

You will need to load the node object for access to $node. So lets say you extract the href from $variables, you wont be able to load node based on the url, atleast I dont know any function that does it. You will need to extract (php explode etc) node nid and then use node_load($nid) to load the $node object and then you can populate the preview based on a field of $node.  

Where to write the code? 

You can either override the theme function or use the preprocess, the preprocess for this should be (though not sure) yourtheme_preprocess_links__system_main_menu(&amp;$vars) and theme override will be yourtheme_links__system_main_menu. I hope you understand the difference between theme function override and preprocess. I'd suggest preprocess to add preview in $variables and then overriding theme function to use that value. OR, you can build the preview and add it as an attribute to the link.

Hope that helps.