Hi I found that if the parent node is Node2D, the canvas layer still can be added to it. Even though Node2D is not the parent node of canvas layer. So I am confused about your answer. If the node2d can replace the node in this tutorial ?
There are two types of hierarchy, "type" hierarchy and scene-graph hierarchy. Type hierarchy is a lineage of properties (like color) and functions like translate(). A child of Node, like Node2D is a Node but has new properties and functions relate to them. Some nodes are type-children of others. Node is the base type of all scene trees. Node2D is-a 'child' of Node; Node2D has new properties and functions. Line2D is-a child of Node2D so it has its own unique properties (points) and functions.
Scene-graph hierarchy is hierarchy of containment, like a bag you might have, you put things in it. Node is the most basic kind of 'bag'.
In short, be aware of these distinctions in tutorials.