Nope, they won't work together. Milwaukee and DeWalt use completely different battery connectors and systems even though they're both marketed as 20V. The actual voltage is slightly different too - Milwaukee runs at 18V nominal while DeWalt is 20V nominal - but the real issue is the physical incompatibility. The battery contacts and housing shapes just don't match up, so you can't physically fit a Milwaukee battery into a DeWalt tool or vice versa. This hasn't changed over the years and likely won't, since both companies have their own ecosystems locked in.
Each brand has stuck with their own battery platform for ages now. DeWalt has their FlexVolt system which works across their 20V and 60V tools, and Milwaukee has their RedLithium batteries that work within their own lineup. If you want to use both brands, you're basically looking at maintaining two separate battery collections. The good news is that as long as you keep them straight, they're both solid platforms with good battery availability, so it's just a matter of charging what goes with what.