Why doesn't a dimensional inconsistency arise while defining a physical quantity in multiple ways? Let's say that we have defined a certain physical quantity from a particular relationship and then we find another relationship and define the physical quantity again.
For example,
$$v = u + at$$
$$\text{and }v = \sqrt{u^2+2as}$$
where $v$ denotes the final velocity, $u$ denotes the initial velocity, $a$ is the acceleration, $s$ denotes the displacement and $t$ denotes the time.
Why are the dimensions of the physical quantity, when evaluated using the first relation, the same as those when evaluated using the second relation?
I know that this might sound like a silly question and the answer to this is most likely trivial but it seems like I have some misconception that is preventing me from fully grasping it, which I hope to clarify.
 A: Basically, it's because your two equations aren't definitions, they're results.
It's like saying, "What if we define $100 = 10 \times 10$ and then define $100 = 80 + 20$? How do we know if these definitions are consistent with each other?" The question doesn't actually make sense. Those equations aren't definitions, they're results.
In physics, you derive results by starting with definitions (for example, velocity is defined as $v = dx/dt$) and applying mathematically valid operations, such as multiplying both sides by something. All of these steps keep the dimensions of both sides the same, so the final results have consistent dimensions as well.
A: The reason is probably not anything deep. It is simply the fact that when you have a specific quantity, such as velocity in this case, the dimensions of quantity is determined by what it physically represents, and not by the equations that one can use to compute it in different scenarios. Still, the equations must produce dimensions that match those of the quantity. This is because these equations represent physical situations where these dimensions have physical meaning. I don't know how to explain this any better.
A: The answer is to think of it backwards.  We don't start by saying $u+at$ and $\sqrt{u^2+2as}$ have equivalent units.  We start by saying that, fundamentally, we think of "velocity" as a thing which is a physical quantity.  If two expressions for the same physical quantity yield different units, we strongly question whether one of them is fundamentally wrong.
Over the years, we have developed an axiomatic model of how units work.  The traditional calculus for quantities defines the concept of a unit Z, and a quantity, which is $\mathbb R \times [Z]$ (a real number "multiplied" by a unit).  From there, they define how that multiplication should distribute over other arithmetic operations, such as
$$x\times[Z_1] + y\times[Z_1] = (x + y) \times [Z_1]$$
$$x\times[Z_1] \cdot y\times[Z_2] = (xy) \times ([Z_1]\times[Z_2])$$
$$\sqrt{x\times[Z_1]^2} = \sqrt x \times [Z_1]$$
and so forth.  And, of course, we defined the concept of unit multiplication and division that we are now used to.  We defined "dimensionality" to capture whether it was meaningful to add treat units as different "spellings" of the same quantities, or if they were fundamentally different.  Several common dimensionalities are length, time, area (length squared), and speed (length divided by time)
Over time, what we found was that equations which were consistent with this particular treatment of units could be "right," while those which were found inconsistent basically never were.  So we declared these to be the "right" way to handle units, and added constants to handle any oddities that might occur.
Now I do note that these are incomplete.  There's two corner cases where people disagree on the best way to handle units.  One of them is angles.  Technically radians are dimensionless -- they are a length divided by a length.  However, many people have found it convenient to treat radians as having a dimensionality of "angle."
This catches more mistakes, but runs into problems like the small angle approximation $sin(x\times[rad]) \approx x$ for small $x$.  This obviously runs into trouble if radians have a dimensionality that we can't just handwave away.
The second area that causes problems are trancendentals.  Decibels (dB) is a famously troublesome case because there is a logarithm in the equations for it.  To date, we do not have an axiomization for such extended units, only the 7 major dimensions that we are used to from SI, so we have to admit that our quantity calculus is incomplete.  For a handling on these issues, I recommend the article from Metrologia,
On quantity calculus and units of measurement if you can access it.
So in the end, the math works because we spent a lot of time finding math that fit reality.  And, when necessary, we fudge it and create incomplete rules to keep it in line with reality.  I wish there was a more precise answer, but that's the best we've managed over hundreds of years of scientific inquiry!
A: One may add to @knzhou's answer that dimensions can be modelled mathematically in a consistent way as explained in Terry Tao's post here: https://terrytao.wordpress.com/2012/12/29/a-mathematical-formalisation-of-dimensional-analysis/
This is a refined version of the following intuition:
We do not model the space of "length" as $\mathbb{R}$, but instead as $L = \mathbb{R} \mathrm{m}$. The element $1\, \mathrm{m}$ defines a basis for $L$, just as $1\, \mathrm{ft}$ does. The change of basis matrix is given by the equation $1\, \mathrm{ft} = 0.3048\, \mathrm{m}$.
If similarly $M = \mathbb{R} \mathrm{kg}$ is the space of masses, you can define the space "mass $\times$ length" as $M \otimes L$, and $\mathrm{kg} \otimes \mathrm{m}$ is the canonical basis induced by the given bases on $M$ and $L$.
In this view, the choice of units becomes as arbitrary as the choice of bases in linear algebra; and the dimension of a quantity is reflected in the vector space in which it lives (e.g. $M \otimes M \otimes L \otimes L \otimes L$). As a side remark, the canonical basis element of the dual $L^*$ evaluates to one on $1\, \mathrm{m}$ and hence can be thought of as $\frac{1}{\mathrm{m}}$, explaining how inverse dimensions can be modelled.
