Depends on what you mean if the flag art is a flat rectaangle shape just use the align panel or the align tools in the control panel
If you need a stylized flag waving Use eithether the Object>Envelope Distort> Make with Warp>Flag Command Or the Effect>Warp>Flag
if you want a more realistic or more freeform waving flag
you do it with the Object>Envelope Distort> Make with Mesh and manipulate the anchor points.
Read the help files about Envelope Distort, Aligning objects and Warp Effects
I'll give you a clue for the warp and mesh you need to group the flag art and the text before distorting it.