Many questions here.
Well, units have a formal definition in the sense that every physical quantity has two parts: A quantity and a unit. Take "distance". How would you describe distance using just a number? That's impossible. Stating just a number would immediately lead to the question "... of what?".
Think about it like this: Everything you measure is stated as a ratio to a base quantity: How many meters? How many kilograms? How many seconds? These base quantities are the units.
With that in mind, it's immediately clear why you can't add or subtract quantities with different units: Since a physical quantity tells you "how much of what", it just makes no sense to say "3 meters plus 2 seconds".
You can, however, multiply or divide quantities of different units, which gives you new units: Velocity is distance per time, so the unit of velocity must be the ratio of a unit of distance and a unit per time. It could be kilometers/hour, meters/second, miles/minute, whatever you can think of.
Since you cannot add quantities of different units, it immediately follows that you cannot take the $\exp$. Let's take the $\exp$. You might know that
$$\exp(x) = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + ...$$
Now if $x$ was, for example, "one meter", you would start adding things like
$1 + 1m + \frac{1}{2} m^2 + ...$
but remember, you cannot add those! It doesn't make sense to add a number, a distance, an area, a volume etc etc.
Regarding the logarithm, here's something to consider: The log has a product rule like this $\log(a\cdot b) = \log(a) + \log(b)$.
Hence, you can in principle take the logarithm of a quantity with units, but only if you don't care about extra additive constants:
$\log(10 m/s) = \log(10) + \log(m/s)$, and the logarithm of "1 meter per 1 second" would be regarded as an additional constant that we don't care about.
But in general, when your function is not just a simple power, then you cannot apply it to a quantity with units.
About conversion of units: First, you can of course change the base quantity and measure distance either in meters, feet, miles or whatever, and the conversion is then achieved by a simple multiplication.
You cannot "directly" convert between units that are meant to measure different things, i.e., you cannot convert meters to seconds. Sometimes the special context of your situation allows you to find "equivalent" quantities. In the US, recipes for baking usually tell you how many cups of flour, butter, sugar etc to use. So here the recipe measures the volume. In Europe (at least Germany and Austria), recipes are usually stated in terms of weight: How many grams of flour, butter, sugar, and so on. You can of course convert between those if you know the density of your product.