Is there any way to create twig extension without a plugin? I want to create custom twig extension without any plugin dependency. Is anyone has solution for this?
Short answer:
No.
Longer answer:
Sorry, no... but there's a good reason for that.
Twig is a template language. PHP is business logic.
In proper application design, you separate the business logic from its presentation typically in some sort of MVC structure.
This sounds complicated, but it really makes your website/application a lot easier to maintain over time and keeps the different components from bumping into each other which can also improve security. (I'm looking at you WordPress where template code is often scattered over various plugins, themes, and much more.)
Plugins (and also modules upcoming in Craft 3) typically fall into the business logic category. Twig does a lot by itself but sometimes you need to write some PHP to do more—which I'm assuming you're trying to avoid.
Twig itself is obviously PHP so if you want to extend it, you need to write PHP.
What kind of Twig extension do you want to create?
The most common is a Twig filter, where a template sends Twig a value and then your code wrestles with the data and sends something back.
This is straightforward to do. If you use pluginfactory.io it will generate the necessary bootstrapping needed to get a Twig filter working.  Also check out Cameron's Spear's write up on the nitty gritty.
On the other end of the spectrum, creating your own tags (such as {% myTwigTag %}) and tests requires more work.
That should be more of a rare occurrence but it has been done (for example Marion Newlevant's Break/Continue extension).