It originated from the world of gambling, specifically dice games. If someone rolled the dice and didn't get the desired result, they would say "no dice" to indicate that their attempt was unsuccessful.
Over time, the phrase evolved to express refusal or impossibility in a variety of situations.
Here are some examples:
* "Can I borrow your car?" "No dice, I need it for work today."
* "Let's go to the beach this weekend." "No dice, I have to study for finals."
* "Can I get a refund?" "Sorry, no dice. The sale is final."