Solution #1 Item Count Order
You will need to structure data to display index by adding property to nodes. So in your .ts file update interface to add properties you need, similarly as below (note that code is not complete I assume you already have at least default component from Angular Material Tree Examples :
IN TS:
interface FoodNode {
id: number; //THIS IS YOUR ORDER NUMBER
name: string;
url: string;
children?: MenuNode[];
}
const TREE_DATA:2 FoodNode[] = [
{
id:"1" //THIS IS YOUR ORDER NUMBER YOU WILL REFER IN HTML AS {{node.id}}
name: 'Fruit',
url:'/fruitCategrory'
children: [
{id:"1",name: 'Apple' , url:'/fruit'},
{id:"2",name: 'Banana', url:'/fruit'},
{id:"3",name: 'Fruit loops', url:'/fruit'},
]
}
];
IN HTML:
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<!-- This is the tree node template for leaf nodes -->
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding>
<!-- use a disabled button to provide padding for tree leaf -->
<button mat-icon-button disabled></button>
{{node.id}}.{{node.name}} <!-- THIS IS YOUR ID -->
</mat-tree-node>
<!-- This is the tree node template for expandable nodes -->
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding>
<button mat-icon-button matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
{{node.id}}.{{node.name}} <!-- THIS IS YOUR ID -->
</mat-tree-node>
</mat-tree>
Solution #2 Item Count
Additionally, for those who are looking for item count of nested items under the parent node code is below. For an example Component Page Builder has 3 children: Home Page , Website , Footer where "5 Website" has 5 items and so on....

To display count simple add {{ node.children.length}} as in code below:
<cdk-tree [dataSource]="dataSource" [treeControl]="treeControl">
<!-- This is the tree node template for leaf nodes -->
<cdk-nested-tree-node *cdkTreeNodeDef="let node" class="tree-node">
<!-- use a disabled button to provide padding for tree leaf -->
<button mat-icon-button disabled></button>
<a
routerLinkActive="active"
*ngIf="node.url; else noLink"
[routerLink]="[node.url]"
>{{ node.name }}
</a>
<ng-template #noLink> {{ node.name }} </ng-template>
</cdk-nested-tree-node>
<!-- This is the tree node template for expandable nodes -->
<cdk-nested-tree-node
*cdkTreeNodeDef="let node; when: hasChild"
class="tree-node"
>
<button
mat-icon-button
[attr.aria-label]="'toggle ' + node.name"
cdkTreeNodeToggle
>
<mat-icon class="mat-icon-rtl-mirror">
{{ treeControl.isExpanded(node) ? "folder" : "folder_open" }}
</mat-icon>
</button>
{{ node.children.length }} <!-- HERE IS YOUR COUNT -->
{{ node.name }}
<div [class.tree-invisible]="!treeControl.isExpanded(node)">
<ng-container cdkTreeNodeOutlet></ng-container>
</div>
</cdk-nested-tree-node>
</cdk-tree>