When we started this term we were taught the definition of a vector field as "a function $F:\mathbb R^n \rightarrow \mathbb R^m$ with the only restriction that $m \ne 1$ (else it would be a scalar field)".
Now a few days back we were taught the definition of the line integral of a vector field over a certain curve. However, the definition is done on a vector field $F:\mathbb R^n \rightarrow \mathbb R^m$, which doesn't specify that $n$ must be equal to $m$. If $m \ne n$ then the dot product $F(\phi(t)) \cdot \phi'(t)$ ( where $\phi(t)$ is a curve $\phi: \mathbb R \rightarrow \mathbb R^n$) cannot be computed, since $F(\phi(t))$ is a vector in an $m$-dimensional space while $\phi'(t)$ is a vector in an $n$-dimensional space.
So one of these must be wrong. Either a vector space is a function $F:\mathbb R^n \rightarrow \mathbb R^n$, $n \ne 1$ or the definition of a line integral only applies to vector fields in which the domain and codomain have the same dimension. Which of these is incorrect?
You are right in being suspicious. The definition of line integral only applies to vector fields (not "spaces" as you have written) in which the dimension of the domain is the same as that of the codomain.
This is because, in differential geometric terms, a vector field is essentially a map that assigns to each point of a manifold (in your case, $\mathbb R^n$) an element of its tangent space, and it can be proven that tangent spaces to a manifold have the same dimension (as vector spaces) as the dimension of the manifold (as a manifold); and it is on manifolds that the theory of integration of fields turns out to be most natural.
However, in real analysis, nobody would stop you if you wanted to define vector fields that assign to each point(-vector) of $\mathbb R^n$ a (point-)vector of $\mathbb R^m$, with $m \neq n$ – although these are more commonly called "vector-valued functions (of many real variables)".