The historical prominence of the slave trade in both the Christian and Islamic worlds should make it quite clear that it was hardly "unthinkable" but instead very rationalizable.
Rigid systems of social power hierarchy and oppression based on ancestry, perceived race, and occupation (which is a lot of what the worst part of caste is) were very much features of Christian and Islamic societies, even if their religions didn't codify them.
The "Hindu" caste system results from the history of social hierarchy in the Indian subcontinent. What you are calling "Hinduism" is a relatively recent construct that has emerged as a response to religions with more centralized/uniform doctrines and institutions. There are belief systems categorized under this "Hinduism" label that overtly reject caste systems (and have done so for centuries), while others overtly uphold it.
Other societies also have caste systems, just differently rationalized than the one present in some belief systems that fall under the "Hindu" banner. I'm not excusing any of these systems whether Hindu or not - they are all a blight on humanity - but they are also a feature of many societies whether or not they use the particular term "caste".
Some clear examples of excluded/oppressed castes outside of the South Asian context are the Burakumin in Japan, the al-Akhdam in Yemen, and the Mestizos with more indigenous ancestry in Latin America.
The existence of caste systems outside Hinduism doesn't change this either.
Some objects are red in and of themselves, while others can be made red by something outside them. Likewise, some beliefs cause people to act in certain ways, while other people may act in the same ways tangentially to, or even despite, their belief.
All window dressing imo over the real morals at play under all these layers that society puts on top and frequently changes by the decade. What do liberals and conservatives want out of their countrymen for example? The same exact thing ultimately: good people who might lend them a cup of sugar and won't club them over the head for one. Of course propaganda has blinded people on either side into vilifying what is at the end of the day a fungible human with the same basic needs and wants as most other social animals. At the most base we have the moral principles a stray dog seeks out in either fellow dogs or a sympathetic human: let me find someone who won't fight me off and may in fact share things and help me out while I do the same for them.