You could use two DataLoaders, create the iterators using loader_iter = iter(loader), and grab the next batch in each iteration as from the loader you want via next(loader_iter).
This approach would give you the flexibility to apply complicated conditions when to use which dataset.
On the other hand, if you want to switch between both datasets in each iteration, you could create a custom sampler and create the indices for the ConcatDataset as you wish.
In the simplest case you could return the indices as: [dataA_idx0, dataA_idx1, dataA_idx2, ... dataB_idx0, ...].