It isn't a chain of command, it is a tree. And there are specialist advisors outside the "tree of command."
Here is a halfway recent table of organization and equipment of an Armored Brigade Combat Team in the U.S. Army.
- There are three Combined Arms Battalions, the main maneuver battalions of the brigade.
- There is an Engineer Battalion with two Engineer Companies, among others.
- There is a Headquarters and Headquarters Company, which contains an engineer coordinator, an engineer section, and a terrain team. These are specialized engineers who stay with the brigade commander.
The brigade commander could decide to attach one of the Engineer Companies to one of the Combined Arms Battalions. This is basically an order from the brigade commander to the commander of the Engineer Battalion which says "give one of your companies to the Combined Arms commander." It could be until a specific date, or until further notice. From the moment this order is given, the Combined Arms Battalion commander would not have to pass orders for the Engineer Company through the Engineer Battalion.
Before that happens, the brigade commander would talk with the engineer coordinator, and also with other staff officers, about the best way to use the engineers.
So specialist troops like engineers are not allowed "to do their thing" regardless of orders. A wise commander will consult their representatives on staff, and perhaps even the Engineer Company commanders, before the operations order for the Brigade Combat Team is written. But then the engineers are under orders like any other unit.
Denis mentioned Blitzkrieg. Regarding the chain of command, the key concept here is mission-type tactics, Auftragstaktik in German. It means that a commander doesn't give subordinates simply orders what to do but explanations why they are to do it, and how it fits into the overall intentions.
Imagine a maneuver battalion commander gives an order to his scout platoon leader (a direct subordinate): "Put one of your teams on this ridge so they can observe that road and warn me if the enemy comes from the south."
The scout platoon leader tells the sergeant of one squad: "The battalion wants to be warned of enemy movement on that road, to put half your squad on this spot on the ridge over there."
The squad leader tells the team leader: "Battalion wants to be warned of enemy movement on that road, so put your team on this spot and report."
As the scout team arrives on the spot which looked neat on the maps, they find that trees prevent clear observation of the road. So the scouts on the spot can select a better place in line with the battalion commander's intentions. Of course they must report what they are doing. It would be bad if another scout team sees "enemy soldiers creeping up on our observation post" and call down artillery.
And even with Auftragstaktik the battalion commander could still order a platoon "hold Hill 0815 until you are explicitly permitted to withdraw."