In the Navy you can join with up to four of your friends (same gender). You can go through recruit training with these friends and even get assigned to the same station after training. To get assigned at the same duty station you and your friends will have to sign up for the same job/category and be one of the following: Seaman & Firemen or Airman. Getting assigned to the same station is not that important, you will make plenty of friends where every you go. If you have concerns about making it through recruit training without somebody you know; this program is perfect for you.
When joining the Air Force you can join with one friend of the same sex. This will ensure that you both go through basic training together but after that you will be on your own. If you sign up for the same job you could likely go to the same tech school together and maybe your first duty station, but at this time you will be focused on your own career.
The Army has had a “buddy program” for a long time, but they might not be offering it right now. You will have to ask your recruiter; it may depend on your job, location, etc.
For the most up to date information on the “buddy program” ask a Recruiter