D only refers to the stereochemistry of the enantiomeric carbon farthest from the most oxidized carbon. In a Fischer projection it will be carbon 5 (with right facing OH group) in the common aldohexoses. It is true that naturally occurring sugars are the D isomer though.