ImGui is an immediate mode UI library for C++. That is veeery different from libgdx's Java-based, stateful scene2d.ui. While I have not used ImGui, I'm not a fan of immediate mode for anything but simple UI and I certainly wouldn't create UI using C++. It can all be done of course but whenever we're talking about UI we're talking about degrees of pain, not whether it's possible to hammer a nail with a rock.
scene2d.ui solves a number of major problems that most (or all) UI toolkits have: sane layout, hierarchical transforms, events, low complexity. Especially having a solid approach to layout is crucial, since that is 90% of building UI. scene2d.ui is built on top of scene2d, which is at its core just a handful of classes. It's all very simple and easy to read code, making it easy to understand and customize. Don't like how buttons work? Create your own, possibly by copy/pasting existing classes and making changes.
libgdx also comes with the many benefits of Java, some of which are: fantastic tooling, code changes are hotswapped into a running app greatly reducing restarts, and a relatively straightforward and simple language that has been ruined by silly language feature fads. All this is true even though I am a libgdx author and I wrote most of scene2d.ui. 😃