"Isn't this in contradiction to postmodernism which preaches that no
singular narrative can explain the progression of history and
everything is random ?"
You say that like 'no singular narrative' means 'history is random'. That would be a pretty serious misreading of postmodernism, and, a weird argument.
Foucault interpreted historical development as primarily shaped by power dynamics, and a great deal of culture as implicitly about taking or securing power. That's different to a metanarrative, like Fukiyama's interpretation of (Hegelian) progress, in that it's a system of critique of narrative creating. That is, postmoderist thought doesn't aim to find the patterns in history and interpret it's 'message' or direction, but instead analyses and critiques those who do. For Foucault, the language of history is power, and helps us make sense of what we see. But what we claim it tells us to do, is a power-claim.
"The work of an intellectual is not to mould the political will of
others; it is, through the analyses that he does in his own field, to
re-examine evidence and assumptions, to shake up habitual ways of
working and thinking, to dissipate conventional familiarities, to
re-evaluate rules and institutions and to participate in the formation
of a political will (where he has his role as citizen to play).”
-Foucault in one of his final interviews, in 1984
Derrida is a noted critic of Fukiyama's ideas, saying in 1993, 4 years after 'The End Of History And The Last Man':
"Instead of singing the advent of the ideal of liberal democracy and
of the capitalist market in the euphoria of the end of history,
instead of celebrating the 'end of ideologies' and the end of the
great emancipatory discourses, let us never neglect this obvious,
macroscopic fact, made up of innumerable, singular sites of suffering:
no degree of progress allows one to ignore that never before, in
absolute figures, have so many men, women and children been
subjugated, starved or exterminated on the earth." -from Specters of Marx:
The State of the Debt, the Work of Mourning and the New International
Postmodernism is not hegemonic, it's lots of tactics and approaches, varying by domain of application. Foucault might focus on power. Kuhn might see Fukiyama as stuck in one economic paradigm. Others might focus on postcolonial power dynamics and a battle for cultural supremacy and associated soft-power.
As discussed here, postmodernism is better thought of as a toolbox for criticism and analysis, not a school with one opinion on everything:
Does postmodernism in art criticism collapse into relativism? What's its merit?
To see more recent postmodern thinking, you might have a look at:
Need help with this paper on epistemic justice