A human's perception and experiences are truly unique; our brains weren't preprogrammed - we collected memories of external stimuli through our senses and through the complex associations that were created we learned to be who we are. Our bodies came with a simple OS that runs a 'life support system', but as far as cognition goes, the hardware wrote the software itself; I suppose somewhat equivalent to 'we are the sum of our memories and experience'.
The Doctor and Data however had an information dump into their hardware, they didn't 'learn' to be who they are, their personalities were prewritten; and even though they may learn new things from that point is it likely their personalities will change significantly?
If their matrixes or positronic brains were completely blank and formed associations themselves through their experiences I think that would count as sentience; a simple data dump though and they would be completely different.
The question based on your assumption, then, is: what would happen if you completely wiped Data or the Doctor's memories, leaving intact only the basic OS that they need to maintain 'life'? And then let them run?
It's canonical that Data had a childhood of a sort. He started, more or less, as a blank slate and Soong had a bastard of a time convincing him, for example, to wear clothing because the colonists didn't like having an anatomically correct android running around naked. The vast, vast majority of what he became by, say, Nemesis, was not pre-programmed in, but learned. The Doctor's entire stint on Voyager can also be viewed as a childhood. Yes, he came pre-programmed with extensive knowledge of medicine out of the box, but he came with pretty much nothing else. And much of what he knows now was not a data-dump, but learned through experience and then applied.
And as for signifigant personality changes as a result of that learning: take season 1 doctor and compare him to season 7 doctor. The difference is quite astounding. Data is more difficult, because much of what we describe as personality is defined by our emotional reactions to events, and how we socialise. Data has a distinct liability because he, for the bulk of his life, literally had no emotions - even more so than a Vulcan, who has those emotions but supresses them.
Finally, Star Trek, including Voyager, has numerous examples of organic beings having their brains taken over, modified or enhanced. Is Kes suddenly not sentient because her brain was overwritten by Tieran's in Warlord? Or the entire crews's because their memories were tampered with in Unforgettable? There are cybernetic organisms, too, like Seven of Nine? Her cybernetic enhancements grant her the ability to download vast quantities of information directly into her brains, after all.