When I call a schedule task in main class Must I put the task class at the same datapath of the main class?
No, it is the same way all classes are. You can have your main class in namespace\pluginname, and have the task in namespace\pluginname\tasks\importanttasks\superimportanttasks if you want, as long as you utilize it correctly. You would only need to create a use statement for it, or write the full path when using it.