It is difficult to say if Hindu mythology has any history or how much is history and how much allegory. It is definite that there is a lot of allegorical component in Hindu mythology.
Brahma tells Narada "This brief account of the manifestation of the
Lord is what is called the Bhagavata. The Supreme Being Himself gave
the knowledge of it to me. I have also given to you a brief account of
the Lord's glories and attributes. You elucidate it with the help of
your imaginative power in a way that will generate devotion in the
mind of men for Sri Hari who is the soul and support of all."
Srimad Bhagavata Purana II.8.51-52
The Supreme Lord is said to be fond of such figurative expositions of
spiritual truth through stories. (For it is understandable even to
common men while an abstract philosophical statement can be understood
only by a very few.
Srimad Bhagavata Purana IV.28.65
In times past I learnt this wonderful allegory, which teaches the
truth of the Atman indirectly in a story form.
Srimad Bhagavata Purana IV.29.85
I am adding this part after reading the clariification in the comment.
Archaeology suggests that there is some historical truth in the Mahabharata. Modern scholars find less certain evidence for Ramayana compared to Mahabharata. None of the major Ramayana sites have been clearly identified. That is not the case with the Mahabharata.
The Mahabharata is much more real than the Ramayana. And, therefore,
much more fascinating. Every conceivable human emotion figures in it,
which is the reason why it is possible to identify with it even today.
The text itself states that what is not found in the Mahabharata, will
not be found anywhere else. Unlike the Ramayana, India is littered
with real places that have identifications with the
Mahabharata.(Ayodhya or Lanka or Chitrakuta are identifications that
are less certain.) Kurukshetra, Hastinapura, Indraprastha, Karnal,
Mathura, Dvaraka, Gurgaon, Girivraja are real places: the list is
endless. In all kinds of unlikely places, one comes across temples
erected by the Pandavas when they were exiled to the forest. In some
of these places, archaeological excavations have substantiated the
The Mahabharata critical edition Introduction by Bibek DebRoy
The truth or otherwise of Hinduism can be examined at three levels
(1) Literal truth
(2) Mythic truth
(3) The Numinous truth
(1) Some Hindus claim everything in scripture is literally true. In particular they claim the weapons and technologies described in the Itihasas were literally present and used the way it is described. This would be very difficult to reconcile with actual recorded history (India's vulnerability to foreign invasions that could have been stopped if Hindus had flying machines and celestial weapons that were invoked only with the power of the mind)
Similarly they claim all the Gods exist literally and all their histories recorded in scripture including sthala Puranas really happened. This once again boils down to faith - it cannot stand the test of science both for the lack of evidence and the fact that the same event is described differently in different scriptures ("Kalpa Bheda" introduces another unverifiable reality).
If the claim that Brahmastra is real is borne out, that would be a literal truth of Hinduism:
Brahmastra is released by Gayatri Mantra but in a different way.
Any weapon or even a grass straw can be energized by concentrating and spelling Gayatri Mantra in exact reverse sequence of its syllables.
This method of chanting a mantra is known as viloma (normal way is anuloma).
Combined effect of anuloma-viloma chanting multiplies the power of that mantra and sadhaka attains siddhi quicker than normal.
(2) Mythic truth
This is each person's truth, as Devdutt Pattanaik says. Popular images, like Hanuman splitting his chest open to reveal Rama and Sita evoke powerful responses in Hindus, believers or not. Enactments of myths like Ram Lila or Shura-samhara act as a deep bond bringing Hindus together evoking shared images in their hearts and minds. The scientific test of truth does not apply to mythic truth. The ecstasy of Bhakti to your favorite deity falls under this truth.
For a mythologist, like me, all beliefs are mythological as they are indifferent to rational thought. Hence they make room for fantastic ideas like the ocean of milk, flying horses, and virgin births. Mythology must be distinguished from myth. Myth is subjective truth that defines a culture. Mythology is the body of stories, symbols and rituals that communicates that subjective truth. Different cultures have different subjective truths, hence different beliefs, different myths. For example, Christianity and Islam believe in one life followed by an eternity in Heaven or Hell. Hindus and Jains and Sikhs and Buddhists believe in rebirth, one life followed by another, until one breaks free from the wheel of birth and death. Who is right? Believers think they are right; outsiders do not agree. To each his own. Unlike science, where the pursuit is for universal, de-contextual, objective knowledge that everyone has to agree with. Unless one appreciates what myth is, one will always be trapped in arguments on what is true and what is not, a path that ultimately leads to fundamentalist madness and even, unfortunately, violence.
(3) The Numinous truth
This cannot be put into words and can only be experienced. Whoever was fortunate enough to be around Ramakrishna Paramahamsa or Ramana Maharishi, for example, would have felt the power of their realization directly. The numinous is ultimately the basis of all the other truths - but they act as pointers to the numinous and therefore they are all true in that sense.
The Numinous can stand the test of science - but those who don't feel it can dismiss it as confirmation bias - "the tendency to interpret new evidence as confirmation of one's existing beliefs or theories."
For example, Vivekananda experienced the transcendental with Ramakrishna, but also initially tried to rationalize it:
The first meeting with Ramakrishna so much puzzled the young mind for Narendra that he was feeling anxious to meet Ramakrishna again. He finally went to meet him for the second time on a weekday. During the second meeting, he had another strange experience. When he was talking to Ramakrishna, Ramakrishna suddenly placed his right foot on Narendra's chest and Narendra started feeling unconscious, he felt as if everything around him, the rooms, the walls, the temple garden were vanishing away. Narendra got scared and cried out "What are you doing to me? I have my parents, brothers, and sisters at home." Ramakrishna laughed and moved his foot from his body. He restored his consciousness and said "All right, everything will happen in due time."
Narendra became even more puzzled and felt that Ramakrishna had hypnotized him.
Like any library, Hinduism Stack Exchange shares great information, but does not offer personalized advice, and does not take the place of seeking such advice from any Acharya, Pundit, astrologer, Guru or other trustworthy Counselor.