Confusion with Law of Equivalence
The idea of a chemical equivalent relies on a compound's properties with respect to the usual reactions that occur with a few select species that tend to behave in very predictable ways.  In this case, the number of grams of sodium that would react with 8 grams of elemental oxygen, 23g Na, are one equivalent of sodium for oxidation-reduction purposes.

$\ce{Na_2O_2}$ is sodium peroxide.  It contains oxygen (normally a very well behaved element, chemically speaking) behaving in an unusual way, bonding not only with sodium but also with another oxygen atom.  The oxygen can be thought of as part of a peroxide ion, $\ce{O2^2-}$.  

If you know about oxidation and reduction, then you'll remember that oxygen usually has an oxidation number of -2, but when it is in a peroxide it has an oxidation number of -1.  Because this particular compound involves the -1 state, it takes twice as much oxygen to react with a given amount of sodium (which in both compounds has an oxidation state of +1.

Finally, and perhaps more important in answering the root source of your trouble here, a scientific law is a thing that describes the behavior of the universe in specific conditions.  Outside of those conditions the law does not apply.  Even inside those conditions laws are often incorrect to some degree (though still useful approximations.)  It's not unexpected that we would find some exceptions to this law.