Let y=mx
Then the limit becomes:
$\displaystyle \lim_{x \to 0}\dfrac{3\cancel {x^2}\sin(mx^2)}{(3+m^2)\cancel{x^2}}=0$
This is independent of $m$, so the limit exists.
For the second, the limit will depend on $m$, so it will not exist.
$\displaystyle \lim_{x\to 0} \dfrac{m\cancel{x^2}\cos(mx^2)}{(3+m^2)\cancel{x^2 }} = \dfrac{m}{3+m^2}$
So depending on the direction you approach (0,0) changes the limit.
SlipEternal, that does not follow. There exist examples where the limit, as we approach a point along any straight line is the same, but the limit as we approach along, say, a parabola, is different.
For example, $\displaystyle \lim_{(x,y)\to (0,0)} \frac{2x^2y}{x^4+ y^2}$. If we take y= mx, this becomes $\displaystyle \lim_{x\to 0}\frac{2x^2(mx)}{x^4+ m^2x^3}= \lim_{x\to 0}\frac{2mx^3}{x^2(x^2+ m^2)}= \lim_{x\to 0}\frac{2mx}{x^2+ m}= 0$.
But if we take x going to 0 along the parabola $\displaystyle y= x^2$, we get $\displaystyle \lim_{x\to 0}\frac{2x^4}{x^4+ x^4}= \lim_{x\to 0}\frac{2x^4}{2x^4}= 1$.
(This example is from Thomas' Calculus, eleventh edition, page 983.)
Looking at the limit as (x, y) goes to the limit point along two lines (or any finite number of different curves) can tell us that the limit does NOT exist if we get two different results along two different curves (so SlipEternal is correct for the second problem) but cannot tell us that the limit exists.
The best way to handle such a problem is to change to polar coordinates so that the distance from (0,0) depends only on the variable r. If, in polar coordinates, the limit, as r goes to 0, is a constant, independent of $\displaystyle \theta$ then we know that we can get arbitrarily close to that constant by getting sufficiently close to (0, 0), the definition of "limit".
In polar coordinates, $\displaystyle x= r cos(\theta)$ and $\displaystyle y= r sin(\theta)$ so this becomes
$\displaystyle \frac{3r^2cos^2(\theta)sin(r^2sin(\theta)cos(\thet a))}{3r^2cos^2(\theta)+ r^2sin^2(\theta)}$.
(I can't seem to find the error here. It is "\frac{3r^2cos^2(\theta)sin(r^2sin(\theta)cos(\the ta))}{3r^2cos^2(\theta)+ r^2sin^2(\theta)}.)
We can cancel $\displaystyle r^2$ in both numerator and denominator to get
$\displaystyle \frac{3cos^2(\theta)sin(r^2)sin(\theta)cos(\theta) )}{3cos^2(\theta)+ sin^2(\theta)}$
$\displaystyle \frac{3cos^2(\theta)sin(r^2 sin(\theta)cos(\theta))}{2cos^2(\theta)+ 1}$.
The only dependence on "r" is in the "$\displaystyle sin(r^2 sin(\theta)cos(\theta))$" term. Since $\displaystyle sin(\theta)cos(\theta)$ is finite for all $\displaystyle \theta$, as r goes to 0, that term goes to 0 so the numerator goes to 0. The denominator goes to 3 so, the fraction goes to 0 for all $\displaystyle \theta$. The limit is, in fact, 0.