Is the closed interval $[0,1]$ always needed to do homotopy? I came across the use of the unit interval widely in Homotopy between two maps or two continuous functions between two topological space, I'm really interested to know why this interval is used so widely and whether it is  always needed for studying homotopy?
 A: The idea behind a homotopy is to allow an object to "live" for a finite period of time. The interval $[0,1]$ (and its topology) corresponds very naturally to the classically accepted idea of what a bounded time interval is.
If your idea of time is different, or if the space where your object "lives" has an unusual topology, it may be relevant to use another definition. But I have never seen that done.
A: You ask why is $[0,1]$ is used so widely in homotopy theory. I could try to give a philosophical answer but I would rather give a literal and practical answer: it is used because it is extremely useful.
The relation of homotopy that is defined using $[0,1]$ has many applications. Because of this utility, there is an entire branch of mathematics called "homotopy theory", which constitutes a large slice of "algebraic topology", which itself constitutes a large slice of "topology" as a whole. 
Rather than attempt to convince you by cataloguing a lot of applications (and it's a long list that grows regularly), let me focus on just one early and rather spectacular application, which may be familiar to you from your studies in homotopy theory. 
In topology you learn very early on about the most important equivalence relation amongst topological spaces, namely homeomorphisms. Two spaces $X,Y$ are homeomorphic if and only if there exist continuous functions $f : X \to Y$ and $g : Y \to X$ such that $g(f(x))=x$ and $f(g(y))=y$. Classifying topological spaces up to homeomorphism could be regarded as the pinnacle problem of topology.
Somewhat later you learn about the weaker equivalence relation of homotopy equivalence: two spaces $X,Y$ are homotopy equivalent if and only if there exists continuous functions $f:X \to Y$ and $g:Y\to X$ such that the functions $g \circ f : X \to X$ and $f \circ g : Y \to Y$ are homotopic to the identity; in turn that last part means that there exist homotopies $h_X : X \times [0,1] \to X$, and $h_Y : Y \times [0,1] \to Y$, such that $h_X(x,0)=g(f(x))$, $h_X(x,1) = x$, $h_Y(y,0) = f(g(y))$, and $H_Y(y,1)=y$.
You also learn about some of the homotopy invariants of a topological space $X$, including abelian group invariants such as the first and second homology groups $H_1(X;\mathbb{Z})$ and $H_2(X;\mathbb{Z})$. 
And then you learn a rather spectacular theorem, which uses homotopy to classify all topological spaces that are compact, connected surfaces:


*

*The classification of surfaces: If $X,Y$ are two compact, connected surfaces then the following are equivalent:
(1) $X,Y$ are homeomorphic; 
(2) $X,Y$ are homotopy equivalent; 
(3) the abelian groups $H_1(X;\mathbb{Z})$ and $H_1(Y;\mathbb{Z})$ are isomorphic to each other and the abelian groups $H_2(X;\mathbb{Z})$ and $H_2(Y;\mathbb{Z})$ are isomorphic to each other.
There's still more to the theorem than this, namely a list of all possible values of $H_1(X;\mathbb{Z})$ and $H_1(X;\mathbb{Z})$ which allows one to write down very specific lists of all surfaces, but I won't go there because in my statement I am attempting to highlight the homotopy connections.
Probably from your homotopy theory studies you already know why (1)$\implies$(2); it's kind of obvious from the definitions. And you probably also know why (2)$\implies$(3); it's one of the early applications of homology groups in an algebraic topology course. Amazingly enough, (3)$\implies$(1) is also true, its proof is intricate and beautiful.
