The incident commander is designated by the agency with jurisdiction over the incident (or via Unified Command when multiple jurisdictions are involved).
Example:
In a city structure fire, the local Fire Department—having jurisdiction—designates the Fire Chief (or an assigned deputy) as the Incident Commander on scene.