I just don't understand how a object with 2 ends can be unidimensional.
The dimension of the string is a special case of the concept of dimension for a much more general class of objects called manifolds.
Manifolds are a mathematical abstraction and generalization of the concept of a surface (like the surface of a sphere). The dimension of a (real) manifold is, roughly speaking, the number of coordinates (real numbers) necessary to specify a point on the manifold. For example, the surface of a sphere is two-dimensional because any point on the surface can be uniquely identified by a particular lattitude and longitude, each of which is a real number.
A string is a one-dimensional manifold (or manifold with boundary in the case of open strings which have endpoints) because it takes precisely one real coordinate to specify each point along the string.
In the case of open strings, one can take the coordinate $t$ along the string to be some real number in the closed interval $[0,1]$ where $0$ is the coordinate for one end of the string, $1$ is the coordinate for the other end, and any point in between has some coordinate between $0$ and $1$.
For open strings, one can take the coordinate $\phi$ to be an angle because closed strings are just loops. Simply choose one of the points along the string to correspond to the angle $0$, then going once around the string corresponds to going once around the unit circle in the complex plane, and one gets back to the original point after a total angle of $2\pi$ radians.