I know this because I built an iPC into a G4 box a decade ago, all I could fit in there was a m-ATX board, I used the Microstar MS-6368 and I had to modify 4 upright can capacitors because they were hitting the removables when closed. Is do-able but you are looking to do some modding, this is no newbie project.
Basically the G4 is the older PPC processor. This is important because OS X Lion (10.7) killed Rosetta, which enabled PPC to work. So you will have to run Snow Leopard (10.6) or another previous OS X version if you want a "modern" operating system. Some of the G4's came with OS 9 as the default operating system. The era of the G3/G4 and colorful iMacs was about the time OS X was in beta stages.
If you can run it, lots of people are happy with Snow Leopard.
Don't expect fast. It's old hardware and has basically ZERO street value. But if it's free and works, it makes a nice project. Personally I'd consider dual booting and running Linux if you like to fiddle. Back in that era, I had good luck with Yellow Dog Linux. Seemed to integrate well with the PPC processors and Mac hardware.