buddhist countries had feudalism
And now you are making a gross mischaracterisation of nirvana. It is nothing like Heaven (Buddhism has heavens and hells too, or higher and lower planes of existence). And no, nirvana does not 'serve the same purpose as a god'.
If the class difference is big, the narrative to justify the difference must be strong; even under serfdom or slavery, there were uprisings when the narrative was weak. The lowest class has to be (to some degree) content with their situation.