Let $X$ be a smooth projective curve over a field $k$, let $P$ be a point on $X$, let $\DeclareMathOperator{\O}{\mathcal{O}} \O_P$ be the local ring at $P$ with maximal ideal $\DeclareMathOperator{\m}{\mathfrak{m}} \m_P$, and let $K = k(X)$ be the function field of $X$. Let's try to define order of vanishing without assumptions and see what goes wrong. We have a filtration of $\O_P$ by powers of $\m_P$:
$$
\O_P \supsetneq \m_P \supsetneq \m_P^2 \supsetneq \cdots \, .
$$
So for $f \in \O_P$, let $v(f) = \max\{r \in \mathbb{Z}_{\geq 0} : f \in \m_P^r\}$. However, without further assumptions on $X$, we already run into trouble. As I pointed out in the comments, let $X: y^2 = x^3$ be the cuspidal cubic plane curve and let $P = (0,0)$. Then $\m_P = (x,y)$, so $v(x) = v(y) = 1$, but $v(y^2) = v(x^3) = 3$, so $v$ is not a homomorphism: $1+1 \neq 3$. One way to remedy this is to insist that the local ring $\O_P$ be a DVR for all $P$, which is equivalent to insisting that $\m_P$ be principal for all $P$. (See this answer for more equivalent conditions.) Then one can easily show that $v$ is a homomorphism by writing an element of $\O_P$ as $f = u t^r$ where $t$ is the uniformizer and $u$ is a unit. In geometric terms, this is the same as insisting that $X$ be nonsingular.
We similarly run into trouble defining the class group. Let $X_0$ be a nonempty affine open subset of $X$, and let $A = k[X_0]$ be its coordinate ring. In order to get a group, we need every fractional ideal of $A$ to be invertible, but this is equivalent to insisting that $A$ be a Dedekind domain. And tying back in with the first paragraph, $A$ is a Dedekind domain iff $A_P$ is a DVR for every nonzero prime $P$.
The definition of a DVR may seem a bit unnatural, at first. But the various alternative characterizations---a local PID, a local Dedekind domain, or a noetherian normal local domain of Krull dimension $1$---arise very naturally.
Even in scheme theory, valuations are still very useful. For noetherian schemes, they show up in the valuative criteria for properness and separatedness, which allow one to determine whether a map is proper or separated (the scheme-y versions of compact and Hausdorff, respectively) purely in terms of DVRs.