Thanks for your reply. Sorry if I wasn't clear.
On pages that have their own url (route) like index.php?route=account/customer, I can access custom function by just appending function name to the url, like this: index.php?route=account/customer/my_function
But for modules, there are no urls or routes as they are loaded on the fly into other pages.
That was my question. I do need to access it from the .tpl, i.e. when I click a button it makes ajax call to this module's controller, if that does make any sense.
Example, I add a function my_fuction() to the account/customer.php
Then I can make an ajax call or access it directly through this url:
index.php?route=account/customer/my_function
It will return or output: foo
Now, if I add the same function to a module's controller, how would I access it. Modules are loaded into index.php and we can have them on any page and can have multiple instances of the same module on a single page.