Here is my attempt. I retrieve the amount of records in the database table. Then i multiply this with random() [a random number between 0 and 1] as Ronald pointed out. Then i retrieve that specific object from the database using the RandomOffset and a limit of 1. Becauce Mendix sees this result as a list using the head list operation i can convert the list to an object.
https://modelshare.mendix.com/models/920a948f-145e-424e-8b75-20ac3ee2daf1/get-random-object-from-database
When the list is present in your DB you could retrieve it with a custom range. Set limit to 1 and offset to a random integer that you generate with a custom java action. You should be able to find some Java code that gives you a random number from a range. When a DB retrieve is not possible you could try to loop over the list with a counter. When the counter reaches the random number return the current iterator and stop the loop.
As an extension to Charles Bronzwaer's answer to do this with an in-memory list.