Although you could do something a bit like this in the material, it would mean the material had to be transparent. Which would make the rest of the mesh look weird.
In fact, all of these example have been done just using a fog actor, like the engine exponential height fog.
You can help it along with fog cards
and volumemetrics