That’s a really interesting question for a couple of reasons. One that isn’t necessarily tied to the import of your question is that Muslims often try to legitimize Muhammad as the “universal” messenger for all mankind because God in Judaism and Christianity only sent prophets to Jews, but Muhammad was for the rest of the world. Obviously that’s not a point you’re making, but thought you might be interested to know that! But it does relate a bit to my answer:
So much could be said about this and a lot of thoughts are swirling around in my mind, but I’ll just stick a few of them to the flypaper here!
First is this: The OT is primarily focused on chronicling the story of the Hebrews/Israelites as the progenitors of the Messiah, which is why it seems like God sends prophets only to them, not outsiders. But I think there are instances where God sent either prophets (in the technical sense) and/or messengers to those outside Israel/Judah. Think of Moses. He actually went back to Egypt primarily to liberate the Hebrews. But we know from the text that Egyptians who heard him and saw the signs and wonders of God actually joined the ranks of the Hebrews in the Exodus (see Ex. 12:38 and compare with Lev. 24:10). Exodus records that there were laws meant for the Hebrews “and the stranger who sojourns with you” (Ex. 12:49). Daniel also comes to mind. While he didn’t go into Babylon specifically to preach a message of biblical repentance, God did use him and his companions to effectuate change in the Bablyonians, even if only temporarily. Elisha was used as a messenger to show Naaman the Syrian that YHWH was the true God and Naaman seems to have had a genuine faith. So I think there are instances that give us a clue as to the heart of God for reaching people outside the nation of Israel or the Hebrew people.
In addition, we have to keep in mind the point of the story of Jonah. Unlike other books that bear the name of a prophet, the book of Jonah isn’t primarily about the message, it’s about the messenger. That gives us a clue as to why it looks unique. It looks unique in that Jonah is sent to give a message to people outside of Israel/Judah. But that factual uniqueness highlights the thematic uniqueness: It isn’t centered on the prophet’s message but on the prophet’s character. The central point of Jonah isn’t that the Ninevites repented, but that Jonah had such contempt for them while God had boundless compassion for them. And think of this: the book doesn’t tell us directly who the author is. But the only one who could have known all of the facts was Jonah, which strongly suggests that he is the one who wrote it. How humbling it must have been for Jonah to not only live through the experiences he had but to also write so honestly and transparently about it. Jonah is indeed a unique book in so many ways. Thank God! We learn about our own hearts and attitudes toward outsiders through Jonah. And we learn about the heart of God through it all as well.
As for how the Ninevites knew how to fast and put on sack cloth, etc.: The biblical passage are written such that it seems like everything that happens does so in immediate succession (Once they believed, they immediately fasted, etc.). But the text doesn’t necessarily indicate that. It could easily have been the case that they asked Jonah what it means to repent and he instructed them. It also is plausible that putting on sack cloth and ashes was a cultural custom common (try saying that three times fast!) to people of the region.
Great question! Hope that helps.