This is only possible for apps that use the correct Apple Media APIs and only for Media. So in many cases you cannot.
Game sounds and other non media sounds cannot be played on the Homepod. (If the game is correctly written backgroud music can be played on the Homepod.)
Apps that work will have an icon on screen to choose to Airplay the audio and you then choose the Homepod in the Airplay pop-up.
If the app does not have this function then you might be able to play the sound by going to the iPAd app screen and getting the Control Centre by swiping down at the top right and choosing the Airplay icon to then pop up the choice to use Homepod. See Apple's documentation
Even then not all apps allow this and you are stuck with iPad speakers - or a bluetooth speaker. Examples of this I have found are Sky and ITV apps.