I was taught in school that out of the 1,24,000 prophets, holy scriptures were revealed to only 4 of them (Musa AS, Dawood AS, Isa AS and Muhammad PBUH). However, I heard some scholars saying even the Veda contains prophesies of Muhammad PBUH. Does this mean what I was taught was wrong?

Vedas are hindu scriptures and you should not believe anything mentioned in it.*
We don’t need any other scriptures to tell us about the Prophet salla Allahu alaihi wa sallam. Our Qur’an and authentic hadiths are sufficient for us to know everything about Islam. As for the hadeeth with the number of prophets, this is not authentic. As for the scriptures, they are not limited to these four.*

Please visit here for detailed fatwa information directly from highly respected scholar