Sándor is exactly right, this generally isn't true. However, there is a related statement that is always true, instead of blowing up strict transforms of $N_1$ and $N_2$, you should blow up total transforms.
Blowing up total transforms
Suppose that $I_1$ and $I_2$ are the ideals defining $N_1$ and $N_2$ in $M$. Let $$Y_1 = Bl_{I_1} M = Bl_{N_1} M.$$
Now define the total transform of $I_2$, denoted $\overline{I_{2}}$, to be the ideal formed by extending $I_2$ to $Y_1$, in other words $\overline{I_2} = I_2 \cdot O_{Y_1}$ (note that by the universal property of blowing up $I_1 \cdot O_{Y_1}$ is an invertible sheaf).
$\overline{I_2}$ need not define a manifold, or even a reduced scheme, but we can still blow it up. Set $$Y_{1,2} = Bl_{\overline{I_2}} Y_1.$$
I claim:
Theorem: We have $Y_{1,2} = Y_{2,1}$ where the second object is obtained in the same way but blowing up $I_2$ first.
There are at least two ways to see this.
- You can do this from the universal property of blowing up.
- Since you already assumed that $M$ is a manifold, it is integral. Thus the charts of a blowup can be computed as follows. Suppose $M = \text{Spec } A$ is affine for simplicity. If $\langle x_1, \dots, x_n\rangle$ generate an ideal $I$, then as $i = 1,...,n$ varies, $Y_{I,i} = \text{Spec } A[x_1/x_i, \dots, x_i/x_i, \dots, x_n/x_i]$ are affine charts covering the blowup. $Y_I = Bl_I Y$.
EDIT: As Dustin Cartwright points out in a comment below, blowing up $I_1$ followed by blowing up $\overline{I_2}$ is the same as blowing up $I_1 \cdot I_2$.
A normal crossings example
I'd like to give you an example in $\mathbb{A}^4 = \text{Spec } k[x,y,u,v]$ showing the difference between blowing up strict transforms and total transforms, even when the $N_i$ intersect transversally (are in normal crossings). Let $N_1 = V(x,y)$ be a plane and let $N_2 = V(y,u,v)$ be a line.
Suppose we blowup the line $N_2$ first, then the strict transform and the total transform of $N_1$ coincide. In particular, $Y_{2,1}$ is the object you were considering.
On the other hand, let's blow up $N_1$ first, in this case the strict transform $\widetilde{N_2}$ of $N_2$ is a line, but the total transform $\overline{N_2}$ of $N_2$ is two lines. $\overline{N_2}$ contains the strict transform but also one of the new $\mathbb{P}^1$'s lying over the origin of $N_1 \subseteq \mathbb{A}^4$. The blowups of the strict and total transform of $N_2$ on $Y_1$ are thus manifestly different.
One can check that $Y_{1,2} = Y_{2,1}$ if you did the total transform blowup, and so blowing up the strict transforms does not commute.
Note: If I recall correctly, you can also do the example when two planes are kissing. $N_1 = V(x,y)$, $N_2 = V(u,v)$. The same sort of thing happens, but it's even messier. I've seen this example in various papers on resolution of singularities.
In the literature
The difference between strict and total transforms plays a key role in modern resolution of singularities algorithms. Even though conceptually strict transforms are much easier to think about, they are much harder to compute or control. Thus modern algorithms tend to use total transforms instead in SOME places, and then peel off any copies of the exceptional you can, while possibly leaving embedded components.
See for example:
- Section 7 of This paper by Bravo-Encinas-Villamayor
- Example 2.3 of This paper by Howard Thompson