Does a uniform magnetic field attract iron? I observe that either end of a bar magnet attracts a piece of iron. My understanding is that the magnet induces mini-magnets in the iron.  So what happens if a piece of iron is placed in a uniform field, such as inside an MRI machine?  Does it move, and if so which direction.  I imagine it does not move, and deduce that a magnetic field gradient is necessary to attract a piece of iron.  Is this correct.
 A: The equation given above is correct with $\vec m\bullet \vec B= |m||B|cosθ$ with $m$ the magnetic moment of the ferromagnetic particle or piece placed inside the homogeneous magnetic field $B$ and $θ$ the angle between these two magnetic vectors.
In order a piece of ferromagnetic material as described above without being initially magnetized placed randomly inside the $B$ homogeneous field and free to move, not to be drawn into translational motion  by the homogeneous $B$ field it must have its induced magnetic moment $m$ perpendicular to the $B$ vector of the homogeneous field,
Magnetic force:
$$
\vec{F}=\nabla(\vec{m} \bullet \vec{B})=\nabla(|m||B| \cos 90)
$$
and the total gradient must be zero.
However, this is not physically possible in this case for two reasons:
First an induced magnetic moment $m$ in ferromagnetic matter (not permanently magnetized prior) is always parallel aligned inside a homogeneous field $B$ vector therefore the angle $θ$ will be always zero. This is always the case because the unpaired electrons bound in the atoms of the ferromagnetic matter will experience a torque $τ$ that will align coherently their  individual magnetic moments of all the unpaired electrons parallel to the $B$ field vector even if their were initially at an angle to the B vector $θ=90°$:
$$\tau=\mathbf{m} \times \mathbf{B}= |m||B|sin90=|m||B|$$
Secondly, a homogeneous field like for example the $B$ field inside a Helmholtz coil has  ideally zero curl but the induced magnetic field in ferromagnetic matter is always it total, inhomogeneous thus it has a non-zero curl.
Therefore there will be always a gradient present and therefore a magnetic force $\vec{F}$, propelling the free to move iron piece forward in motion (i.e. assuming it is light enough) to the direction of the $B$ field vector. Imagine your iron piece as being inside the matter or part of the matter of a permanent magnet but instead bound and hold in place by the atomic forces it is free to fly inside the permanent magnet. In which direction it will fly inside the magnet? Of course to the direction of the $B$ vector inside the magnet from S to N. The situation you are asking is exactly the same in comparison.
Here is a video demonstration from a paper time-lapse of one week, of billions of magnetite 10nm nanoparticles suspended in a ferrofluid thin film, continuously circulating to the B field of an external magnet. The magnetite particles after one week get so strong magnetized that concentrate all in one small region forming a tiny solid sphere permanent magnet at the center (the sphere shown in the video is no more than 3mm):
https://www.youtube.com/watch?v=B2PIfpf8BLE
Notice, that the nanoparticles  are suspended inside the carrier fluid of a 50μm thick thin film disc of ferrofluid. The disc is placed horizontally on a desk on top of a permanent bar magnet which is placed on its side (i.e. left and right in the video are the locations of the poles of the permanent magnet). The nanoparticles are suspended inside the thin film free to move and not subjected to gravity.
The above are not to be confused with the situation where you approach a ferromagnetic piece free to move, close to a pole of a magnetic source. The polar fields are always non-homogeneous because the fields at these regions are curling towards the opposite pole. In this case to whatever pole N or S you approach you iron piece the induced magnetic moment $m$ in the iron piece will be also parallel to the external field of your magnetic $B$ field source and attracted to join with it. Similar to the situation of iron filings sprinkled over a magnet.
The similarity comparison described before in a previous answer about the nearly homogeneous field existing between two unlike poles N and S of two separated magnets is not entirely correct. There is not a  zero point in an attracting field N-S between the two separated poles. Otherwise it would not be entitled as homogeneous or nearly homogeneous. Probably this was confused with the repulsing field between two separated like poles N-N or S-S. These repulsing fields are always non-homogeneous and indeed assuming the two like poles are equal strength there is a zero magnetic flux region dead zone at mid-distance where there is no magnetism present. If you  place your small iron piece there it will not experience magnetism.
All the above described cases hold also for permanent magnetized matter that what we call as magnets assuming the magnets are not forced artificially hold in place and are free to move. A magnet approached to an external field  or left inside a homogeneous field will always if needed re-orient its permanent two poles, in space and turn to align its magnetic moment $m$ parallel to the $B$ vector and experience all the same force and torque described previously.
https://www.youtube.com/watch?v=cKAG8v6mvXU
A: You are correct. Magnetic field gradient is necessary to attract a piece of iron. As iron is lump collection of magnetic dipoles, its force will be $ \vec F=\nabla(\vec m\bullet \vec B)$, if magnetic field is uniform, no gradient will be present, so it will not move to neither direction.
More intuitive explanation can be made. You can generate nearly-uniform magnetic field by placing it between two equally strong magnet. Then, in the center, the iron bar will get force from each direction equally, therefore, net force will cancel out, so the iron will not move.
A: In an uniform magnetic field, pieces of iron are not accelerated to one of the poles. But when one of the dimensions is much greater than the others, (like in a needle), it tends to align with the field.
It can be easily verified in a container full of water, in a room protected from winds or vibrations, where a floating device carries a light steel bolt or needle. It slowly aligns with the earth's (uniform) magnetic field. But it doesn't have a preferred border of the container to move.
A: 
[I] deduce that a magnetic field gradient is necessary to attract a piece of iron. Is this correct.

Yes, this is correct.
The (linear) force exerted by a magnetic field $\vec{B}$ upon a small magnetic dipole $\vec{m}$ is given by the formula
$$\vec{F} = \nabla (\vec{m} \cdot \vec{B})$$
In the case where the magnetic dipole $\vec{m}$ is perfectly aligned with the magnetic field $\vec{B}$, this reduces to
$$\vec{F} = \nabla (|\vec{m}| \cdot |\vec{B}|) = |\vec{m}| \cdot \nabla |\vec{B}|$$
where the '$\cdot$'s signify ordinary scalar multiplication, and were added only for ease of parsing (for some people at least).
If we define $m = |\vec{m}|$ and $B = |\vec{B}|$, then
$$\vec{F} = m\nabla B$$
Clearly the force is in the direction of the gradient of $B$ and not necessarily in the direction of $\vec{B}$.
Outside of a typical bar magnet, the gradient of B (remember, it is an absolute value) points approximately toward the nearest pole, N or S. But the $\vec{B}$ field (outside the magnet) flows from the N pole to the S pole. That is why a piece of iron is (almost always) attracted to the nearest pole of a magnet, rather than always to the south pole or always to the north pole.
So, a small piece of iron in a magnetic field will be attracted to either pole, depending upon the direction of the gradient, or will have no magnetic force exerted upon it, if it happens to lie exactly at a point where the gradient is $\vec{0}$.
However, a piece of iron at such a point is in unstable equilibrium, like a ball on top of a hill. The forces acting upon a piece of iron a small distance away from a point such that $\nabla B = \vec{0}$ will be in a direction away from that equilibrium point rather than toward it.
A nano-particle of iron suspended in a fluid is subject to Brownian motion. If such a nano-particle were originally at a point of unstable equilibrium, Brownian motion will tend to move it ever so slightly away from that point of unstable equilibrium. Once it has left that point of unstable equilibrium, the magnetic force acting upon it will become non-zero. Equilibrium will be lost.
