For the Draconic Bloodline sorcerer subclass, can I only choose my dragon ancestor from the kinds listed in the Draconic Ancestry table? Or is it possible to choose an unlisted type of dragon (such as a Shadow Dragon or a Purple Dragon) as my dragon ancestor?
The feature is ambiguous. You should ask your DM.
The Draconic Ancestry feature (PHB, 102) states
At 1st level, you choose one type of dragon as your ancestor. The damage type associated with each dragon is used by features you gain later.
A table is then included that lists the chromatic and metallic dragon types from the monster manual. Notably the text of the feature makes no reference to the Draconic Ancestry table. This can be compared to a Dragonborn's Draconic Ancestry feature that directly states the player must choose from a list (PHB, 34)
Draconic Ancestry. You have draconic ancestry. Choose one type of dragon from the Draconic Ancestry table. Your breath weapon and damage resistance are determined by the dragon type, as shown in the table.
Because the Draconic Sorcerer's features don't reference the table they are not necessarily restricted to it. The table could have been intended to clarify the associated element for common dragon types rather than restrict the player to those types.
There are several things to consider, however:
RAW does not specify the Elemental Affinity of unlisted dragon types. As such, if you choose one, your DM must make a ruling about what damage type is appropriate. It would not violate RAW for a DM to rule that the Elemental Affinity inherited from a Shadow Dragon matches that of the dragon before it was corrupted by Shadowfell.
The DM creates the lore of the world, including what types of dragons exist and whether they might have any descendants. Trying to choose a dragon type that isn't on the table is more likely to conflict with your DM's imagining of the world and so may be disallowed.
Choosing an unlisted dragon type is unorthodox. If your DM wants to stick strictly to RAW then they might well be uncomfortable with your using an unlisted dragon type. In addition, because the feature doesn't specifically allow using other dragon types whether or not they are allowed by RAW is a matter of interpretation.
A DM might very well rule, however, that other dragon types are allowed. Doing so is unlikely to break game balance Draconic only has mechanical impacts in terms of its associated damage types and fire is a RAW option and arguably the best choice. I cannot see how one damage type would be more powerful than choosing a fire type dragon without a very specific multiclass build1.
1: A Sorcerer with two levels in Warlock with a force type dragon ancestor could theoretically add their Charisma twice to each beam of eldritch blast. Even this possibility, however, comes at the cost of rarely benefitting from your elemental resistance, having fewer leveled spells that deal force damage, and missing higher level spell slots.
RAW: You can only select one of the listed options. Mechanically the problem of selecting some unknown dragon should be evident in the fact your class features wouldn't have a table to refer to for Elemental Affinity.
You can always ask your DM for leniency or adjustments for the subclass though.