The Air Force will -- at times -- work someone outside of the job they were trained in. This usually happens when someone does something that results in temporary disqualification from their normal job, or if someone volunteers for a special job or project. For example, in some squadrons, there may be a "team" of three or four volunteers to form the squadron "small computer team." These individuals would be volunteers from within the squadron, to install and maintain small computers or the small computer network within the squadron. Many of the larger Air Force squadrons have such volunteer teams.
Navy. The Navy calls their enlisted jobs "ratings." The Navy offers two programs: Guaranteed Job, and Undesignated Seaman. While both programs are available, most enlist under the Guaranteed Job program. Again, whether or not you will be offered the job you want depends upon your qualifications, and the needs of the service. Undesignated Seaman can "strike" for a job after basic training. The Navy also has some "special" enlistment programs whereby you can enlist knowing what "area" you are going into, but not your specific rating (job). An example would be the Nuclear Program. These programs generally require higher ASVAB line scores, and require a longer service commitment, but offer accelerated promotions, greater training opportunities, and higher enlistment bonuses.
Marines. Like the Army, enlisted jobs in the Marine Corps are called "MOS's." The Marines also offer two programs: Guaranteed Job, and general field. Very, very few Marine applicants get a guaranteed job (mostly those with college degrees or high ASVAB scores, applying for certain, designated technical specialties). It's been my experience that a majority of Marines are enlisted in a general field (such as Avionics), and will have their actual job (MOS) designated during basic training. One must remember, in the Marines, one is expected to want to be a MARINE, first & foremost. MOS (job) is a distant second.
Coast Guard. Like the Navy, enlisted jobs in the Coast Guard are referred to as "ratings." Of all of the services, the Coast Guard offers the fewest guaranteed jobs. One normally enlists in the Coast Guard, undesignated, then "strikes" for a job after a period of on-the-job training in "basic coastguardmanship" at their first duty station. A few schools (and therefore jobs) are offered during basic training. While this system may seem (on the surface) disadvantageous, there is something to be said about having the chance to spend some time scoping out the situation "on the job," before deciding what job you're going to "strike" for.
As well as offering the fewest guaranteed jobs, the Coast Guard has the fewest overall jobs (about 23) of any of the services. On the plus side, for the most part, all of the Coast Guard jobs directly relate to a civilian occupation. Additionally, with so few job categories, Coast Guard personnel "specialize" less than the other services. As one Coast Guard member told me, in a 20 year career in the Electronic Tech (ET) rating, he's worked on communications from radio to satellite communications, radar, all forms of navigational equipment, lighthouses, telephone, computers, crypto, and electronic warfare. Those would be spread out over several different MOS/AFSC/Ratings in the other services.
Reserves and National Guard. The Army National Guard and Air National Guard, as well as the reserve forces of all the branches give "guaranteed jobs" to everyone who enlists. This is because, unlike the active duty forces, who recruit for available slots all over the world, Guard and Reserve recruiters recruit for specific unit vacancies in their local areas. Therefore, when you enlist in the Guard or Reserves, you enlist into a specific job slot in a specific Reserve or Guard squadron/division/company, etc.
Avoiding becoming Job-Locked
Regardless of what some of the military recruiting commercials on TV indicate, the military is not a job-placement agency. When you get to MEPS, you may find that you don't qualify for the job you wanted, or you may find out that the job you want is simply not available. This is especially true for jobs that everyone wants (like computer programming), or jobs that only have a few people assigned. For example, the Air Force has over 22,000 Security Forces (cops) assigned. Compare that to the 285 physical therapist specialists authorized, and you can see that the chances of jobs being open for Security Forces is several dozens of times greater than openings for physical therapists.