Is it possible to gain valid information and knowledge through dreams?

Answer: Dreams can give you an opinion but not valid information. It may include warnings and expectations. Prophet Joseph(pbuh) told his dream to his father in the following verses:

إِذْ قَالَ يُوسُفُ لِأَبِيهِ يَا أَبتِ إِنِّي رَأَيْتُ أَحَدَ عَشَرَ كَوْكَبًا وَالشَّمْسَ وَالْقَمَرَ رَأَيْتُهُمْ لِي سَاجِدِينَ

One day Joseph said to his father: My daddy, I saw eleven stars, the sun and the moon in my dream. I saw them making obeisance to me

قَالَ يَا بُنَيَّ لاَ تَقْصُصْ رُؤْيَاكَ عَلَى إِخْوَتِكَ فَيَكِيدُواْ لَكَ كَيْدًا إِنَّ الشَّيْطَانَ لِلإِنسَانِ عَدُوٌّ مُّبِينٌ

He said: O my little one! Do not tell your dream to your brothers. Because Satan is an obvious enemy to man

وَكَذَلِكَ يَجْتَبِيكَ رَبُّكَ وَيُعَلِّمُكَ مِن تَأْوِيلِ الأَحَادِيثِ وَيُتِمُّ نِعْمَتَهُ عَلَيْكَ وَعَلَى آلِ يَعْقُوبَ كَمَا أَتَمَّهَا عَلَى أَبَوَيْكَ مِن قَبْلُ إِبْرَاهِيمَ وَإِسْحَقَ إِنَّ رَبَّكَ عَلِيمٌ حَكِيمٌ

This happens like this; so your Lord will choose you and teach you the interpretation of events; he is going to complete his favors to you and to the family of Jacob. As he completed his favors to your previous ancestors,  Abraham and Isaac. Your Lord is Knowing and Wise. -Surat Yūsuf 12/4-6

Eleven brothers of Joseph appeared as eleven stars , his father and mother appeared as the sun and the moon in his dream. One day they were going to vail in front of him. Since Joseph(pbuh) was thrown to a pit and taken to Egypt , he was separated from his father. Jacob(pbuh) was in deep sadness and it made his eyes go blind. Almost all of his hope was over but the dream of Joseph was giving him some expectation

فَلَمَّا أَن جَاء الْبَشِيرُ أَلْقَاهُ عَلَى وَجْهِهِ فَارْتَدَّ بَصِيرًا قَالَ أَلَمْ أَقُل لَّكُمْ إِنِّي أَعْلَمُ مِنَ اللّهِ مَا لاَ تَعْلَمُونَ

When the harbinger came and laid the shirt on his face, Jacob started to see again. He said: Did I not say to you that I know a thing with Allah’s notification which you do not know.  -Surat Yūsuf 12/96

“If a dream gives a definite information, why do you think Jacob(pbuh) burn himself out?”

Prophet Muhammad(peace be upon him) told one of his dreams to his companions; they all headed to Mecca together. His dream did not come true and they had to go back from Hudaybiyyah. After this incident, Allah the Almighty sent down the verse:

الْمُؤْمِن۪ينَ وَاَلْزَمَهُمْ كَلِمَةَ التَّقْوٰى وَكَانُوۤا اَحَقَّ بِهَا وَاَهْلَهَا وَكَانَ اللّٰهُ بِكُلِّ شَيْءٍ عَل۪يمًا لَتَدْخُلُنَّ الْمَسْجِدَ الْحَرَامَ اِنْ شَاۤءَ اللّٰهُ اٰمِن۪ينَ هُوَ الَّذ۪يۤ

Allah confirms that dream of the Messenger is true. When the determined time of Allah comes, you will all enter Al-Masjid-al-Haram, having your heads shaved or having your hair cut, and within security. He knows what you do not. Before it, he granted you a victory(conquest of Mecca). –Surat Al-Fatĥ 48/27

If we could trust the dream only, Allah would not send down a verse such as this one. Although,  dreams can contain some  good news and warnings. Overall of threse we can say that dream is not  the way to obtain valid information or knowledge, it may only get related with the one who sees it.