Add node ID to template variables
If you want to access nid inside preprocess_page you should try something like this

arg(0) will return 'node' and arg(1) will return node nid.

Provided you must be inside a node.

if (arg(0) == 'node' &amp;&amp; is_numeric(arg(1))) {
  $nid = arg(1);
  if ($nid) {
   $node = node_load($nid);
   // creating the node variable
   $vars['node'] = node_load(arg(1), NULL, TRUE); 
  }
}