I don't understand what is teffilat shav as in Mishna Berachot. Does it mean that one is not allowed to pray for something that is already known to be fixed and would surely occur? I was thinking if Hashem is beyond Time and it says in the shmoneh eshre, "Ki Atah Shomea Teffilat kol peh", Wouldn't that mean that a prayer can change the future as it is stated in Midrash about the 5 ways to change our future?
The Mishna to which you refer (Berachot 9:3) says explicitly that a tefilat shav (a vain prayer) is a prayer about the past, not the future.
הצועק לשעבר, הרי זו תפילת שוא.
If one cries out about the past, this is a vain prayer.
The Mishna proceeds to give the example of one praying for his wife who is already pregnant to have a male child, or of someone who hears someone screaming and prays that the screaming not be coming from his own house.
Implicitly, it would be possible for someone to pray that his wife have a male child if she hasn't yet conceived, or for someone to pray that his house be peaceful before he actually hears screaming.
According to Rabbi Yitzchak in Rosh Hashana 18a, prayer is beneficial even after a decree has been sealed, and so it can clearly change the future, even if the future has been fixed.