I love that somebody is still using a Treo! It takes me back to all those years when I was the only one on my block with a smartphone.
The Palm OS is inherently open, unlike iOS, so they don't need to be jailbroken. You can already install any app you like onto it. You have complete access to the file system.
To unlock it, simply call your carrier and ask for the unlock code. They're required to give it to you once you've fulfilled the length of the contract (usually two years). Since Treos haven't been sold in over two years, they're all eligible for legal unlocking.
As for your other question - iPhone 4's can definitely be jailbroken and unlocked. I can do it for you (for a fee), or you can do it yourself. Lots of sites online describing how.
Best of luck -