They key to the question is: What do we mean by $dx$ and $dy$, specifically?
In the end, the definition is the thing, and a real definition is more complicated that one would like.
More generally, if $y=f(x)$ with $f$ differentiable, and $g$ is any "nice" function then:
$$\int_{f(a)}^{f(b)} g(y)\,dy = \int_{a}^{b} g(f(x))f'(x)\,dx\tag{1}$$
when the right side is defined.
This is basically saying we can do substitution to compute $\int_{a}^{b} g(f(x))f'(x)\,dx.$
When $g(y)=1$ for all $y$ this means:
$$\int_{f(a)}^{f(b)} dy = \int_{a}^{b} f'(x)\,dx$$
Unfortunately, this doesn't quite look like $dy=f'(x)\,dx$ because the ranges are different.
In intro calculus, you can probably prove (1). When you define the more general Riemann-Stieltjes intregral, there is a notion of $df$ for integrals. and you'll get:
$$\int_a^b h(x)\,df = \int_a^b h(x)f'(x)\,dx$$
when $f$ is continuously differentiable.
There are more advanced notions, like differential forms, but those are specifically defined just to have this and other properties that you'd expect if you wanted to treat $dx$ and $dy$ as algebraic "things."
In the differentiable form view, we have, for any interval $[a,b]$, a curve in 2D space, $C_{a,b}$, the set of points $(x,f(x))$ for $x\in[a,b].$ Then $dy$ is a form on that curve, and $f'(x)dx$ is another form, and both forms evaluate to the same thing on this curve.
This makes clear that this has to do with a curve in 2-dimensional space, and that is why the ranges in (1) seem to shift - we are actually looking at the boundary points on the curves, $(a,f(a))$ and $(b,f(b)).$
But that view is way above intro calculus.