The figure of speech, if I am not mistaken is personification. JFK is stating that the country can do something(implying human characteristics), but the country CAN'T literally do something for you in the way that is implied.
Similarities- both require lots of schooling and have great pay. Both require great focus and are well respected jobs. They both help people.
Differences- lawyers help people with their legal issues and doctors help people with their health issues.