When guinea pigs have flaky skin, it usually means they have mites - dandruff isn't really a problem in guinea pigs. Other signs of mites (or some other kind of parasite) apart from flaky skin, include scratching, hairloss, fur that has been bitten off near the root and scratches/ lesions on the skin. You may only see one of the symptoms though, so that's enough to warrant a visit to the vet as if left untreated mites can cause the piggy a lot of pain and misery.
Treatment for mites is usually with ivermectin (injectable) or ivomec (oral administration). You need to give the affected guinea pig (and any housed with him) 2-4 treatments, each 7-10 days apart to make sure you get rid of them entirely. During this time you need to clean their housing area thoroughly too, to kill off any eggs.
Don't bother trying any shampoos, sprays or powders you may be able to get from a pet shop as they won't kill all the mites and can be quite unpleasant for the guinea pig - you need something which can get in to the bloodstream.
Also, it's important to see a vet first, so that he/ she can properly identify what is causing the flaky skin. Although mites are the usual culprit, something like a fungal condition or dietary deficiency may be involved. Someone who can see your guinea pig and who is trained and experienced with guinea pig ailments will be able to best advise you.