One epoch is usually defined to be one complete run through all of the training data. The easiest way of doing that is to go through the data in contiguous chunks.
If you pick the samples for each batch at random then you will face two problems.

You will have to copy the batch data before running it through the model, because models generally need contiguous data in each batch.
You will have to keep track of which samples the model has seen in order to be able to tell when the model has seen all the training samples.