People have certainly tried their luck already before the "invention" of dices with other things:
with stones, mussels or wooden sticks. However, from all the popular objects still in use for
gambling dices are likely the oldest. The oldest date back about 5,000 years into the history of
the early civilizations in Mesopotamia. From the Orient, they were later brought by the Romans to
the western world.
Far more than in card games the dice player relies on luck. I.e. in iconography dices serve far better than cards to illustrate the capriciousness of fate and luck. Of course, dice had been always popular among soldiers because they are small, easy to manufacture and very durable. Therefore they were frequently used to to illustrate the everyday life of soldiers.
The Crucifixion (Detail) by Andrea Mantegna; 1457
The Denial of St Peter Creation Date by Bartolomeo Manfredi; 1615-1616
Theseus and Pirithous Playing Dice for Helen by Odorico Politi; 1831
Dice Game by Waclaw Pawliszak; 1892