It is possible using a TCL script on an H.323 or SIP gateway; however, I would recommend against it. Any fax server integrations with UCM would require unique numbers so that UCM could determine how to route the call: to an IP phone or the fax server.
Here are the TCL scripts if you want to look. Essentially what happens is that the gateway answers the incoming call and plays and audio file that sounds like ringtone down the line. Fax machines can usually (not always!) tell the difference and start the trainup sequence. When the DSP hears the appropriate tone from a fax machine, it redirects the call. If it doesn't, it forwards the call to UCM. This adds delay to the call while the gateway figures this out.
http://www.cisco.com/cgi-bin/tablebuild.pl/tclware
I would strongly recommend buying seperate DID numbers as needed for faxing and integrating the fax server with UCM using the T.38 protocol.