Can I make Dota 2 use a previous version of OpenGL or "enable" support for 3.1?
No, you can't run the game with an older version of OpenGL API. Nor can you "upgrade" your software to add OpenGL 3.1 (or newer) support, unless your hardware itself supports it, and newer drivers are available which enable it.
You need to find the detailed specs of your GPU (or CPU if using internal graphics on Intel/AMD) to see if it supports the version of OpenGL, and then if so, make sure you are using the correct drivers for your GPU. Depending on the GPU you're using, and version of Ubuntu you're on, you may need to switch to different drivers.