The id itself has only a single purpose: to identify where the callback came from. It doesn't have any special meaning inside tgui. So there is absolutely no problem with reusing the same id in multiple places.
That being said, you can only bind callbacks from tgui widgets. I do not control hot-keys. If you want your code to be executed when you press a keyboard key then you must call the code yourself. There are two ways to handle this.
The first way requires no change to your current code, but I would advice the second method.
When the key is pressed, you will create the callback and add it in the gui (using an undocumented function

)
Callback callback;
callback.id = QUIT_GAME;
gui.addChildCallback(callback);
Of course where you handle this callback, you can only check callback.id because the other properties of the callback are not set.
The second method is is by binding callback functions instead of using ids.
void quit() {
std::cout << "Quit" << std::endl;
}
button->bindCallback(quit, tgui::Button::LeftMouseClicked);
// When you press the Q button
quit();
You would have to take a look at the
callback tutorial for more info on how to use the bindCallback function. In this example the quit function has no access to the sf::RenderWindow so it can't close it. This could be solved if it is in a class, but then you would have to bind differently (because of the 'this' pointer in class functions), or by using std::bind like the tutorial shows on a tgui::Gui object.