I'm sure they "could", but I wouldn't personally do it. Mostly because my need for everything to have it's own bin, but also because of space and climate. My discoids prefer to be more humid and more heat, plus are ferocious eaters. The dubia [that I don't have any more because they are prohibited in Florida] prefer a dryer, slightly cooler temp and seem to not eat nearly as much.
I guess if you had a big enough bin you could house them together,but I think eventually the population would stress one of the species. If you've only got a few of each and aren't looking for a breeding colony, then no worries.
I have at least 2,000 discoids set up in 2 bins. One with a bioactive substrate I use for breeding and one for gut loading/feeding. Works out well for me. The dubias I *used to* keep in a similar fashion.