if you have your receipt, the box, and the return sticker (if the store has one), abide by the store's return policy, and haven't used very much of it, then yes, they should exchange it.
you cannot, however, simply walk into a mac retailer and exchange your old foundation for a new one because it is the wrong color.
most mac locations have good return/exchange policies, providing that they made a mistake, and that the product is mostly unused. just don't abuse the policy, because in the end, it ends up hurting us all.