In the film 300 we see some Arcadians (or Atheneans I dont remember) joining Leonidas and his army (of 300) against the persians. Greek cities were more or less like independant countries, but what about the military? Was there a Greek Army or each city had an army? Was there like some sort of Greek NATO?
There was no Greek army in ancient times. In fact there was no overarching Greek institutional framework of any kind at the time of the Persian Wars. The alliance against the Persians did not encompass the Greek world, or even mainland Greece; it was an ad-hoc alliance of just 32 states (out of a total of about a thousand), who had never fought alongside each other in such a coalition before and would never do so again.
Smaller alliance systems were common, though, and the coalition against Persia was just a larger version of those, brought together to meet the unprecedented crisis. The ancient Greeks effectively recognised three types of military alliance. The first was a defensive alliance, which only required states to help each other if one of them was attacked by a third party.^1 The second was an offensive or full alliance, which required its signatories to join any war started by any other state included in the alliance. The third - relevant here - was what we call an unequal alliance, which is a treaty that imposed the obligations of a full alliance on some members but only those of a defensive alliance on others (typically, on the leading state, called the hegemon).
The best example of the third type is the so-called Peloponnesian League, led by Sparta. This network of alliances required the Spartans to come to the aid of any member who was under attack from an outside state, but it did not require more: for them, it was a pure defensive alliance. The lesser members themselves, however, were sworn to "share the same friends and enemies as the Spartans, and follow wherever the Spartans lead." For the other members, in other words, this was a full alliance, requiring them to support the Spartans in any military venture they chose.
The Arkadians you see in 300 represent the 3,000 hoplites sent to Thermopylai by Sparta's subordinate allies to meet their obligations as members of the Peloponnesian League. These states did not choose to fight in this war against Persia; Sparta had done that for them, because Sparta had declared that the Persians were their enemies, and Sparta's allies were required to share the same enemies. The Peloponnesian League formed the core of the anti-Persian alliance, and while some states chose to join this new alliance and accept that the Spartans would be its leaders, several other states (notably Argos and Syracuse) did not join the war because they did not accept Spartan hegemony and refused to serve under Spartan command.
The band of anti-Persian allies, then, were a mix of Sparta's own subordinate allies and voluntary members of the wider defensive alliance against Persia. In council, Sparta declared to these allies what the plan would be for that campaign season. The Spartans decreed the share of the levy that each city was supposed to send for a particular campaign, and where they were expected to send them.
The allies often disagreed over strategic priorities and the number of troops required to achieve them, which caused much friction during the fight against Xerxes and would lead to a rapid breakdown of the alliance after the victory at Plataia in 479 BC. By 478 BC it was clear that Sparta would not continue fighting beyond the Peloponnese, and Athens took over as leader of the remaining allies. By the late 460s BC, Athens formally renounced its alliance with Sparta and made new alliances with Sparta's enemies at Argos. There would be many other equal and unequal alliance systems in the centuries that followed, always shifting based on the interests of each state, but whenever a large part of the Greek world would combine forces, it would always be under the leadership of a single hegemonic power (Sparta, Athens, Thebes, Macedon). Right down to the Macedonians, these hegemonic states would all basically continue the same model, requiring their subordinate allies to contribute a certain part of their levy at need (often alongside a fixed rate of annual tribute).