One way is to utilize Common Table Expression. Using a hierarchical query include the topmost parent id in the result and use that as a primary sorting field.
For example something like
WITH
CustCTE (CustId, CustName, ParentId, UltimateParent) AS (
SELECT t1.CustId,
t1.CustName,
t1.ParentId,
t1.CustId
FROM Customer t1
WHERE ParentId = 0
UNION ALL
SELECT t2.CustId,
t2.CustName,
t2.ParentId,
cte.UltimateParent
FROM CustCTE cte,
Customer t2
WHERE t2.ParentId = cte.CustId
)
SELECT cte.CustId,
cte.CustName,
cte.ParentId
FROM CustCTE cte
ORDER BY cte.UltimateParent,
cte.ParentId