You can call a sub-function from a main function in an m-file.
You cannot call a sub-function from a script (what would the function be 'sub' of?!). If you need to then just turn your script into a function.
Edit: In response to your edited question, then Yes, what you are doing is creating a function file and then within it defining subfunctions which are only accessible to the main function of that file.
This does seem like a question that you could have got the answer to yourself instantly though by simply putting that code in a file and running it!