It is no different than my inability to prove you are self-aware. Can you bring me your consciousness on a plate? Hold it up for me to touch, or smell -- even to directly observe, as opposed to indirectly infer? Has anyone in your life ever acted in a way that makes you wonder if they are even capable of the level of introspection that you feel you regularly exercise? Such is the problem with proving the wholly intangible.
While it is true that even today we can program AI within a certain level of interactivity to feign consciousness -- asking Cleverbot "are you sentient?" can go a different way any given day of the week -- but the ability to think about thinking, to observe one's own thought patterns; this cannot be proven of any given creature, but only assumed.
There is an entire episode dedicated to this discussion, of course; The Measure of a Man deals with the trial wherein Data must establish his own 'personhood' in favor of being treated as property of Starfleet.
(Picard and Riker are present to hear the outcome of the research into
PHILLIPA: I have completed my research, based on the
Acts of Cumberland passed in the early twenty first century. Data is
the property of Starfleet. He cannot resign and he cannot refuse to
cooperate with Commander Maddox.
PICARD: What if I challenge this
PHILLIPA: Then I shall be required to hold a hearing.
PICARD: Then I so challenge. Convene your hearing.
that would be exceedingly difficult. This is a new base. I have no
PICARD: But surely, Captain, you have regulations to take care
of such an eventuality.
PHILLIPA: There are. I can use serving
officers as legal counsel. You as the senior officer would defend.
PICARD: Very good.
PHILLIPA: And the unenviable task of prosecuting
this case would fall on you, Commander, as the next most senior
officer of the defendant's ship.
RIKER: I can't. I won't. Data's my
comrade. We have served together. I not only respect him, I consider
him my friend.
PHILLIPA: When people of good conscience have an
honest dispute, we must still sometimes resort to this kind of
RIKER: You just want me to prove that Data is a
mere machine. I can't do that because I don't believe it. I happen to
know better. So I'm neither qualified nor willing. You're going to
have to find someone else.
PHILLIPA: Then I will rule summarily based
upon my findings. Data is a toaster. Have him report to Commander
Maddox immediately for experimental refit.
RIKER: I see. I have no
choice but to agree.
PHILLIPA: Good. And I expect you to do your duty
in that courtroom. If I find for one minute that you are not doing
your best, I will end this then and there.
PICARD: You don't have to
remind us of our duty. You just remember yours.
PHILLIPA: I have
never forgotten it. Not then, and certainly not now.
Apart from this -- the computer has never asserted itself as being sentient when operating under nominal conditions (there are some oddball episodes where an outside force causes it to spring to sentience) nor was it expressly designed to be so. Soong set out to create a self-aware positronic consciousness; his claim matches that of Data's, and indeed Data quests to better himself and grow beyond that which he is already programmed to do. In so doing his acts describe consciousness in the same way that our human actions inform others of our own status as self-aware. The computer on Star Trek does not exercise this level of self-control.
And indeed -- later in the series, he does begin to dream, though it is regarded as a fluke due to an accident. Data receives a message from his creator implanted in a dream sequence, the idea being that "he finally made it" to a certain level of self-awareness, such that his subconscious mind would manifest and express itself.