Doesn't the Experience Machine thought experiment by Robert Nozick refute the idea of Nirvana and Moksha?
I am not entirely convinced that nirvana is refuted by this thought experiment because most of the traditions (that I'm acquainted with) that theorize about nirvana have, at their heart, a notion of detachment from or cessation of desire (grasping.) Since Nozick's whole premise includes:
a machine that could give us whatever desirable or pleasurable experiences we could want
I would think that such a machine would theoretically preclude nirvana, not refute it. One of the hardest concepts to wrap one's mind around is the cessation of grasping for nirvana.
It would be impossible to refute or falsify the reality of Nirvana or Moksha in any other way than in ones own experience. Nozick's idea is not relevant to the issue. His machine would ensure that it's users never discover true happiness, the cessation of suffering or deathlessness. They would be modern lotus-eaters lost in their sensations and emotions. Note that for Buddhists most of our notions of pleasure would be classed as suffering.
I suspect that if you were to expand your question by closely defining Nirvana and Moksha it would answer itself.
The shortness of your question makes it impossible to see how you see these things as linked, a machine that can generate hedonistic sensations, and Awakening. The human body, operated correctly and with sufficient resources, is an Experience Machine. Viewing it like this targets utilitarians, and materialists like Sam Harris, who see morality and the ordering of our lives as derivable with reference to pleasure and pain only.
There is a lot of confusiin about Nirvana, moksha, and other synonyms. Unsurprisingly, because it is generally only defined negatively in the sutras, as what it is not. The deep question the Buddha took up, was "What is the cause of old age, sickness and death?", what are the causes of suffering? After he experienced Awakening, or Unshakeable Liberation from Suffering, he unfolded the answer to this through the four noble truths, the fourth of which is the Eightfold Path which is the practice of Buddhists.
The goal of this is not eternal pleasure, which is just the other side of the coin of pain. It is clearly directed at the domain of meaning, which Nozick's machine cannot operate in. The Buddhist path describes suffering, anguish, as a dream which distracts us. By understanding the character of what it is to be 'more awake', we can navigate suddenly or gradually, to not just a state of mind but a way of being, free from suffering and the causing suffering. In the Kalama Sutra and other places, Buddha describes the essential role for faith in this goal, for a person to be able to go beyond the initial benefits of the practice. It is easy to be a skeptic of Nirvana, because it is an invitation to direct experience, not a concept, or a sensation, or a state of mind. But a completely different way to be.