Yes, very much legal. In all of Canada, you are allowed to record if one person on the line knows of the recording (So you know you are recording the conversation, therefore it's legal). In the US, it depends on the state. The following are states where both parties have to be notified, so you have to announce that you are recording the conversation (By telling them, or having a constant beep):
California
Connecticut
Florida
Illinois
Maryland
Massachusetts
Michigan
Montana
Nevada
New Hampshire
Pennsylvania
Washington
I know caller ID faker will record a conversation if you buy their credits. I've never personally used the service but I believe that it records through their server when you place the call.
There isn't a program that will record calls on the iPhone, and there never will be. It's technically very very difficult and no developer will touch it. Your only choice is one of those programs where you call an external number first.