Well I would say (my memory is finite) nothing happens but in the worst case just an exception like dataloader requires dataset class or something like that. For sure you will find an exception if you use ConcatDataset over non inherited classes.
Well, we are able to run deep learning models without the Dataset class; but loading a dataset is generally memory-intensive — so it’s highly recommended to use the Dataset class.