No, it can’t. At least, NOT the way most people doing VoIP are doing VoIP.
I know this but I’m trying to dumb things down, here, to make them understandable to the OP. But, your diving into the sewer so I’ll have to come along for the ride.
I’ll start with the difference between digital trunks and The Internet, specifically broadband.
A digital trunk is an analog POTS line converted to 64k g.711alaw or ulaw, also referred to as “narrowband voice”. It’s also known as a DS0
24 DS0’s are combined into a DS1, 28 DS1 channels are combined into a DS3, and 3 DS3’s are combined into an OC3. (OC3 is a SONET fiber standard, the others are copper standard)
The PSTN is comprised of a gigantic network of OC3s, OC12, OC48’s and so forth. However all of them can be broken down to the basic DS0 of 64kbps. All of these are “ISDN” standards.
The thing about all of these links is - they are completely lossless. They are NOT Ethernet, they are NOT CSMA (carrier sense multiple access) They are CIRCUITS they have exactly 1 beginning and 1 end. In essense, they are pipes.
There is a newer technology called Carrier Ethernet that is sort of like Ethernet but not really - because the entire circuit paradigm is superimposed on it. Meaning, that a “phone call” in the PSTN is always in that 64k pipe, that “trunk” or “line” and never loses any data. It’s lossless because it only has 1 beginning and 1 end thus nothing else on the circuit can inject packets.
This is why FAX works over a POTS line. Because FAX signals are analog but are converted at the central office to digital and put into this lossless ISDN digital pipe then presumably somewhere else they exit this go back into a POTS line and are converted back to analog and received by the destination fax machine.
Now let’s look at typical VoIP SIP trunks from a provider like Twilio SIP that the OP is using and are delivered over the general Internet. These come over the Internet via TCP/IP. There’s no guaranteed packet delivery on the Internet, there’s no guaranteed packet delivery on IP. Guaranteed packet delivery comes from TCP and the way you make a guaranteed packet delivery work on a network that does not guarantee delivery is through retransmissions. Meaning that if the IP layer loses a packet the TCP layer on top of that retransmits.
This loss takes time to detect and time to retransmit. If your circuit is lightning fast, and lightly loaded, then the retransmits are almost undetectable. These are referred to as “low latency” circuits.
But, you don’t have control over most of the circuits that your packets are traversing. If you run a traceroute you will see this at once - some “hops” have lower latency than others. This latency also varies during the day and night and it can vary from moment to moment. You can have a high latency in one of those links that lasts for 5 seconds then disappears.
Just about everyone on this forum conflates VoIP with The Internet. The OP, Akhil, isn’t talking about running a SIP trunk over some controlled latency network like an ethernet switch with 1 port in a ATA plugged into a fax and another port plugged into another ATA in another fax elsewhere. He’s talking about running a SIP trunk over the most hostile environment possible - the public Internet.
This is precisely why I state categorically that FAX does not work over VoIP. Oh sure - in the lab - when I can control latency and prioritize voice packet delivery - it works great. I can duplicate the vast PSTN with it’s controlled delivery of ISDN data with my little ethernet switch and run FAX over that. Look ma, a dancing elephant.
Now, there IS a loophole in all this. The OP can go to a telephone company, get an Internet line from that company, and then get a SIP trunk from that company. Since the Internet Service Provider in that case is also providing the SIP trunk, they can probably guarantee all their SIP packets will arrive to the customer. But, they probably aren’t going to be a lot cheaper than a POTS line.
But, what the OP is trying to do - save a few bucks on a cheap SIP trunk over the Internet and run a fax machine off that - simply will not work. Unless of course, both machines support T.38 Which is not guaranteed, and which is exactly why his clients report it’s “random” on what faxes go through and what don’t.
He needs to quit banging his head against the wall and just bite the bullet and tell his clients that they need to fork over the money for a FAX line - or, slip FAXes into the dustbin of history and use email attachments like normal people do.