There are many known characteristics of good media. Even if a specific name brand can differ in media codes, there are often clues like the shape of the cakebox, style of the shrink wrap, and especially the "Made in Japan" indicator that help you identify good media. (If you see "Made in Japan," then that's all you need to know. )
Also as bigmike said, many online retailers will sell you the media directly from the manufacturer was opposed to some store brand, and they will post the media code beforehand so you know what you're getting. If you received some other media code from them, then you can return it because they shipped the wrong product. (Though beware, there are many DVDR medias with 'fake' Taiyo Yuden and MCC codes!) If you received what you ordered but it doesn't work well with your burner, then tough luck, you should have researched better or bought a small quantity for testing purposes.
If you bought it in a retail store and forgot to look for "Made in Japan," or whatever, then tough luck unless their return policy is very good. (For example, recently TDK switched from RiTEK to CMC in their CD-R spindles. As soon as I realised, I the open spindle went back to Costco for a full refund.
We were all newbs once.