Unlike Canex, the US Navy Exchange (NEX) and the Army, Air Force Exchange System (AAFES, i.e. the "Post Exchange" or "PX") on US Army and USAF bases, form part of the pay and compensation packages for US Armed Forces Personnel. The NEX and PX often sell goods at minimal to no mark-up and the commissaries often sell below cost. In other words, the US taxpayer subisidizes these stores (NB: the exchanges and commissaries are separate entities, despite often being co-located) and as a result, they are able to pay service personnel less than if they were expected to shop on the regular economy. For this reason, there are regulations restricting foreign military use. It's their system. They're allowed to do that.
Anytime you are allowed to shop in an American exchange, you should treat it as a privilege, because they don't have to allow you to do it. When Canadian ships go into US Navy ports, there is always a line in the LOGREQ requesting NEX privileges, which is always granted, but often with a caveat that this permission does not include the Commissary (although the ship - not individuals - will often be allowed to make minimal purchases from the Commissary).
Having said all this, different bases will look at and treat this differently and that can change from one day to the next. I have frequently used NEX and AAFES stores on leave without problem (including the one in San Diego), but I have also been refused. It never hurts to ask, but be polite and thank them anyway if they say no (it's not the fault of the guy saying so). Remember that if you do get in, the US taxpayer has paid for part of your purchase.
I suspect that your desire to use a NEX may come from wanting certain uniform items that are easier (and cheaper) to get at the NEX than in Canada. If that's the case, try these guys: http://www.uniforms-4u.com. I've never bought anything from them, but it may be worth looking at.