Yeah I don't get how it's even possible, as the info is programmed into the phone switch by the telco. So to me the network should use that and only that. Or maybe some telcos just don't care and will let customers put whatever they want.
For PRI and SIP the number is almost always outpulsed from the PBX, so you can send DID numbers for specific departments, phones, or whatever instead of just your main number.
Many carriers will not allow you to outpulse numbers not on your account, but there are legit reasons to do so. If you have PBXs linked together at multiple locations, each using local trunks but with different service providers, but you want all calls to show the company wide main number. Or you have a third party call center or the like that has their own service provider but needs to be able to call outbound with your number so that they appear to be calling from your company.
Our SIP provider allows us to send out any number at all. It actually comes in handy for me every once in a while. Sometimes I will be doing remote work for a customer at night or over the weekend and need someone to physically do something minor at the location. Power cycle something, or move a patch cable or whatever. These locations run 24/7, so I have a list of a few people I can call that work for the customer that can do these things for me. They are usually running around the building and not sitting in their office though, so I have to call their cells. They don't have my cell number or often even the office number in their phones, so if I call them with my actual caller ID info, they will usually let the call go to voicemail and I'm not able to complete everything I need to until they decide to check their VM. So I will remote into our PBX, change my caller ID to the main line of their office, then call them from the softphone on my cell. They usually answer right away. Of course, they know who I am, so they may be a bit confused since they know I'm not sitting at their location, but it gets the job done.
Speaking of hacking voice mail, we sometimes get automated emails at work for that every now and then if one of our customers gets hacked. We need to go in the switch and restrict toll calls on their line until they get their PBX/IVR fixed. People will hack in and get an outside line then start making overseas calls.
Well, I wouldn't really call it hacking. That's almost always an issue of poor system programming (allowing remote access to outside lines) coupled with poor security (leaving the passwords at default, or using no voicemail password or stupid voicemail passwords like 1234). I did run into one instance where it was a software bug and occurred even when the system settings were properly configured.