Based on there being 22 iMac models, with up to 29 different frequency combinations, and yet - not one specific iMac model was mentioned in the original post ...
'Can an iMac be used simply as a monitor for a G4 tower?', yes.
'If so, how do you do it', connect to it's VGA connector.