Yes, it is a fiction in the notation that $\frac{du}{dx}$ looks like a fraction of numbers, when $du$ and $dx$ are not numbers.
It is a useful fiction - for example, the chain rule can be written as $$\frac{du}{dt}=\frac{du}{dx}\frac{dx}{dt}.$$ There are reasons this fiction works, but it can be tough to explain in an intro class. The question might even be, "What does '$\cos x\,dx$' mean in isolation? What does it mean for it to be equal to $du?$"
And yes, the ultimate answer to that question is in differential forms. But that is a complex topic, which I'll skip here.
In the end, at an intro level, it is better to phrase this result in terms of functions. Treat this as a substitution rule, and prove separately:
If $$F(u)=\int f(u)du\tag1$$ then $$F(g(x))=\int f(g(x))\,g'(x)\,dx\tag 2$$
But $(1)$ means $F'(u)=f(u)$ and $(2)$ means $(F\circ g)'(x)=f(g(x))g'(x).$ And this is just the chain rule.
Your case is $f(u)=u$ and $g(x)=\sin x.$
An additional notation wrinkle is to use Riemann-Stieljes integrals. We can show, if $u(x)$ is differentiable, then:
$$\int_{a}^{b}g(x)u'(x)\,dx=\int_{a}^{b} g(x)\,du(x),\tag3$$ where the right side is a Riemann-Stieljes integral.
In this sense, $du(x)=u'(x)\,dx$ as distributions.
A distribution is a linear map which takes a function $g$ to a number. In this case, $du(x)$ takes $g$ to $\int_{a}^{b} g(x)du(x)$ and $u'(x)\,dx$ takes $g$ to $\int_{a}^b g(x)u'(x)\,dx.$ And we see from $(1)$ that both are equal.
When $f$ is a function whose domain includes the range of $u,$ then we can treat these as distributions on such $f$ by applying the distributions to $f\circ u.$ Then we get from the first part of this answer:
$$\int_a^b f(u(x))du(x) =\int_{u(a)}^{u(b)} f(u)\,du$$
Ultimately, you can think of Stieljes integrals as an introduction to the idea of general distributions, which will ultimately lead to differentiable forms.