How do people calculate what could be the price depending on market cap?
For example, people saying that DGB will hit 1$ at 8billion market cap
You can't.
There are other things you have to consider and you shouldn't solely rely on marketcap to predict the future. not that anyone can correctly predict it besides large investors or group of large investors.
Exactly; that's the reason why it's called speculation. You can use some kind of "ceteris paribus" formula, but even doing so, the output will be still imprecise as past events aren't a good indicator for future performance.