Praxis has listed the Starfleet Branches that should have admirals in command.
Note that Dr. Crusher was chief of Starfleet Medical during the second season and thus should probably have been a temporary admiral during that period. Some people wonder when she took the bridge officers' test but she probably took the flag officers' test.
It is common for line admirals to be in command of fleets or the areas of sea they operate in. In a space navy there may be both territorial (or in space volume) commands and fleet commands.
In an interstellar realm an admiral in command of a volume of space may be in charge of all the fleet defense units int a single solar systems, or in ten inhabited solar systems plus all the uninhabited solar systems beteen them, or some other number of solar systems.
Suppose that in one space navy a one star admiral is in command of 100 solar systems; a 2 star admiral commands all fleet units in 1,000 solar systems and has 10 one star admirals under him; a three star admiral commands all fleet units in 10,000 solar systems and has 10 two star admirals under him; a four star admiral commands all fleet units in 100,000 solar systems and has 10 three star admirals under him; a five star admiral commands all fleet units in 1,000,000 solar systems and has 10 four star admirals under him; and so on.
How far can it go? In our galaxy a galactic empire ruling all the galaxy would rule at least 100,000,000,000 solar systems and the ranks would go up to at least ten star admiral.
What about admirals commanding fleets?
In the great sea battle of Jutland in 1916 between the British Grand Fleet under Admiral Jellico and the German High Seas Fleet under Vice Admiral Scheer there were 249 warships engaged, including 28 British battleships and 22 German Battleships.
Jellico had a vice admiral as second in command and a vice admiral as chief of staff and 13 vice admirals and rear admirals commanding various units.
Scheer had 8 vice admirals and rear admirals commanding various units.
in both fleets the battleships were grouped into battle squadrons that had two divisions each, with three or usually four battleships in a division. Each division was commanded by an admiral with each squadron commanded by one of the admirals commanding a division.
So if a space fleet has a 1 star admiral commanded every five to ten space battleships, it might have a 2 star admiral commanding two such groups or ten to twenty ships in all, a 3 star admiral commanding two 2 star admirals and twenty to forty ships in all, a 4 star admiral commanding two 3 star admirals and forty to eight space battleships in all, a five star admiral commanding two 4 star admirals and eighty to one hundred sixty space battleships in all, a six star admiral commanding two 5 star admirals and one hundred sixty to three hundred twenty space battleships in all.
But in the DS9 episode "Sacrifice of Angels" a fleet of 600 ships is commanded by Captain Sisko! What?
In the Lensman series by E.E. Smith there are battles with fleets of millions of space battleships. Imagine how many different ranks of admirals there would have to be to command in such battles.
Since the federation occupies a volume containing hundreds of thousands to hundreds of millions of solar systems, and Starfleet has at least thousands of space warhips during the Dominion war, if Starfleet is logical it could have vast numbers of line admirals in far more ranks than the shows creators ever imagined.