Manipulating infinitely small $dx$ 
*

*From basic infinitesimal calculus, we know that the $$\frac{dy}{dx}=1$$ implies $$dy=dx.$$ However, what is the exact argument behind this result?

*Now, consider $$\frac{d^2y}{dx^2}=1.$$ Why can't we say that $$d^2y=dx^2?$$
 A: Since this question was posted under the tag infinitesimals it is reasonable to assume that the OP expects an answer in terms of a theory of infinitesimals.  There are several such theories that meet modern standards of rigor.  The most common such system is of course Abraham Robinson's framework for analysis with infinitesimals, relying on a hyperreal number system which is an ordered field properly extending the field of real numbers.
In such a framework, the derivative of $y=f(x)$ is defined as the slope $m=f'(x)=\mathbf{st}\left(\frac{\Delta y}{\Delta x}\right)$ where $\Delta x$ is an infinitesimal increment of the independent variable $x$ and $\Delta y$ is the corresponding increment of the dependent variable $y$, i.e., $\Delta y=f(x+\Delta x)-f(x)$.  Note that, contrary to the infinitesimal-free (epsilon-delta) approach, the ratio $\frac{\Delta y}{\Delta x}$ already contains the full information about the slope $m$, via the application of the standard part function $\mathbf{st}$.
Then the independent variable $dx$ is defined simply by $dx=\Delta x$ whereas the dependent variable $dy$ is defined by $dy=f'(x)dx$.  In the case $m=1$ one naturally obtains $dy=dx$, as the OP suggested.
Similarly, for second derivatives one defines the dependent variable $d^2y$ by setting $d^2y=f''(x)dx^2$ so one naturally has $d^2y= f''(x)dx^2$ and so whenever the second derivative equals $1$ one obtains $$d^2y=dx^2,$$ as the OP suggested.
The notation closely parallels the second differences $\Delta^2 y= f(x)-2f(x+\Delta x)+f(x+2\Delta x)$ and behaves similarly.
For more information see Keisler's textbook for calculus with infinitesimals entitled Elementary Calculus.
Note. For a related post see this discussion of Leibnizian formalism.
A: You can't play with "infinitesimal" objects like that. The expression
$$\frac{{\rm d}y}{{\rm d}x}$$
is not a fraction, but rather a notation of the following limit
$$\frac{{\rm d}y}{{\rm d}x}=\lim_{h\rightarrow 0}\frac{y\left(x+h\right)-y\left(x\right)}{h}$$
A: You can't say that:
$$\frac{d^2y}{dx^2}=1\implies d^2y=dx^2$$
because $\frac{d^2y}{dx^2}$ is not a ratio, it's just a symbol for second derivative.
What you can say is that:
$$\frac{d^2y}{dx^2}=1\implies \frac{dy}{dx}=x+a \implies y=\frac12 x^2+ax+b $$
For:
$$\frac{dy}{dx}=1$$ it's true that it implies that $y=x+a$ and thus that finite or infinitesimal increments $dy$ are equal $dx$. However also in this case $\frac{dy}{dx}$ is not a ratio but just a symbol for the first derivative.
A: The basic, intuitive argument given in most lower division calculus classes is that we can treat the differentials like variables, and perform the kinds of manipulations you suggest.  This was the fundamental intuition (I think) that guided Leibniz's thinking, and lead to the $\frac{\mathrm{d}y}{\mathrm{d}x}$ notation.  However, when analysis was axiomatized and put on a more solid foundation in the 19th and 20th centuries, the field was put in terms of limits, rather than infinitesimals.  Hence the Leibnizian intuition and notation doesn't quite match the modern way of thinking, causing the kind of disconnect that you are seeing.
On the other hand, there is an exact argument, via a field of analysis called non-standard analysis, formalized Abraham Robinson in the 1960s (his book is cited below).  The difficulty is that you cannot treat $\mathrm{d}x$ as an infinitesimal real number—the real numbers are inadequate to the task.  Instead, you have to adjoin or append objects called infinitesimals to the reals, obtaining the hyperreal numbers.
A discussion of non-standard analysis is, I believe, far beyond the scope of this website in general, and your question in particular, thus I would invite you glance at the book cited below.
Robinson, Abraham, Non-standard analysis, Princeton, NJ: Princeton Univ. Press. xix, 293 p. (1996). ZBL0843.26012.
