The requirements to be able to dress as a Marshall are Complete the mission "The last Enemy That Shall Be Destroyed" Clear out all US Gang hideouts within 24 in-game hours. see outfits RDR-14 in related walkthrough link
Go onto the outfit menu and you will find out what you must do to unlock that outfit.
there is no code you have 2 unlock it yourself :)
Go to the outfits menu in the pause menu and you should see what you need to do in order to unlock that outfit.
Yes, you just need to unlock it.
No.
there is not one sorry
look in the outfit section of your journal and it will tell you what you need to do
Yes.
You have to find the 5 Treasure hunters and kill them, Then You get the outfit, Then you go on a mission with them and You go into Mexico
You can not physically join the military in the game. The closest thing to it is the main quest line where you help Reyes overtake the Mexican Government. There are also outfits you can unlock like "The U.S Marshall Outfit" and "The American Army Outfit" But they do not put you in the military.
The War horse code is a code used to unlock the War horse in Red Dead Redemption.
You cannot get a gang in Red Dead Redemption, but you can be part of a gang by accepting a wanted poster, then wear the outfit of the gang, then they won't attack you.