There's no code on the matter, so every plumber has his or her own rules of thumb. Most of the time the waste stub is at 18" a.f.f. for a 30" counter and 20" a.f.f. for 32" counter. The water lines are normally stubbed out at the same height or slightly higher. The toilet supply line stub is normally around 3" or 4" a.f.f. The rough in dimensions become a lot more critical on pedestal lavs and other special basins. If there's anything special, the manufacturer will indicate so in the paperwork. Most of the fixture manufacturer's publish a "rough in book" which includes all the necessary rough in data for every product in their line. If you got a generic vanity from a big box store, the best you can do is use rules of thumb.
"Nothing is foolproof to a sufficiently talented fool"