I used to gamble at work in my free time. I made sure that I'd be doing it when I had nothing to do and it didn't affect my efficiency at work in anyway. So, you could gamble at work but how moral the activity is a matter of discussion.
Now I don't gamble at work mostly because I'm shifted to a busier office and have no time to spare. Adding to that there's no more privacy like at my older office as four of us share the two computers at our desk.