My friend has an X-fact bike made for 29" wheels, so we were wondering if he could put a downhill fork on it or he would need to buy a new frame?
Downhill forks are double crown forks, typically with 180-200mm of travel.
First your frame needs to be designed for use with double crown forks. If not, it is possible to damage the frame when the stanchions hit it while turning.
Second the frame needs to be able to handle the long fork. You have to check with the manufacturer if the frame meets these criteria. If it's not explicitly stated it does not!
Theres a chance for the head tube to snap catastrophically. Also a longer fork will bring the handlebars way up, the seat further back and make the bike not ride as designed anymore, probably worse. Typically only dedicated downhill bikes and some extreme enduros are rated for such forks.
After a quick search for X-fact, it looks like they make entry level MTBs with 100mm travel forks. Putting a longer downhill fork into such a frame is not only dangerous, but will make it also unpleasant to ride.