Nothing prevents this from working, so it works
The Sentinel feat states:
[...] When a creature within 5 feet of you makes an attack against a target other than you (and that target doesn't have this feat), you can use your reaction to make a melee weapon attack against the attacking creature.
This is not ambiguous, if a creature within 5 feet of you attacks somebody who isn't you (that doesn't have the feat), you can use your reaction to make an attack against that creature. Thus, if a Kobold is riding atop a Sentinel Centaur, and somebody attacks the Kobold from within 5 feet, the Centaur can use their reaction to make an attack.
The Mounted Combatant feat states:
[...] You can force an attack targeted at your mount to target you instead. [...]
Thus, if an attack targets the Centaur, the Kobold can have the attack be redirected into targeting the Kobold. this would then trigger the Sentinel feat because there is now an attack being made against the Kobold.
The actual timing of the Sentinel feat's attack is perhaps unclear
I asked a question related to this:
There isn't exactly a lot of rules-text on when "When a creature makes an attack" actually is. But we do know that most reactions happens after their trigger, which in this case is... also unclear. Whether the reaction, and thus its accompanying attack, occur before or after the triggering attack actually hits, misses, or deals damage is going to left to the GM.
And if you think this phrasing isn't unclear, and that it simply always occurs fully after the triggering attack, then feel free to rule so. I say it's unclear because, to me, it genuinely is.