However, what concerns me is what happens on other platforms? Will SDL2 use whatever version of OpenGL is on the machine, or if none available (like on some phones) will it choose the ES versions or another rendering option (with last fallback of software rendering)?
If the version of OpenGL you specify in the context flags is not available, you get a failure.
The default context in libSDL2, for a device that supports OpenGL, is OpenGL 2.1. That's most desktop devices these days. Most desktops provide binary support for later versions, too, even if it requires software rendering. An extension wrangler will help with forward-support on older contexts.
The default context on a device that does not support OpenGL but supports OpenGL|ES 1 is OpenGL|ES 1.1.
The default context on a device that does not support OpenGL or OpenGL|ES 1 is OpenGL|ES 2.0. That's most mobile devices these days.
The default is to not use EGL for OpenGL and to use EGL for OpenGL|ES. Some platforms (eg. Wayland and Mir on Linux) you want to use EGL for everything otherwise you'll get failure, some it doesn't matter (X11) and others (Microsoft Windows) will fail if you try to use EGL for OpenGL.. You may need to probe to see what's supported.
Your best bet is to explicitly set the desired OpenGL version before opening the window, and write to that version. You may want to use an extension wrangler, and you may want compile-time selection between Gl and GL|ES code paths where the two are API-divergent.