By the rules, no. In practice, definitely!
It's perfectly legal to put a GFCI in a 12 cubic inch "Handy-Box". However in practice good luck.
In my book, you got the wrong box. I use the following:
4-11/16" square deep box, but one with "1/2" (13/16" actual) knockouts on the sides.
Not to be confused with a 4x4 box; that'll be too tight.

2-gang domed cover (if it's unfinished work) or mud ring (if to be drywalled)

As you can see from the covers, that box is quite large compared to the GFCI devices, giving at least 3/4" of room behind and to the side of the devices by the time you add a 1/2" domed cover or mud ring.
These boxes are 42 cubic inches + 5-10 for the cover. Is there a plastic equivalent? Not one that's helpful. The plastic "hi-cube" boxes are standard height and put the additional space to the left or right, which is not what you need.
As far as physically mounting a steel box, they do make 'em with mounting flanges for joists, but you can also just drill holes where you need and use them for drywall screws (unlike a plastic box where that's a no-no). Try to buy these boxes at a real electrical supply, they'll have better selection and will charge half the price. Big-box stores really overcharge for these things!
You bring Romex into this box with a readily available cable clamp. Make sure to get 4-11/16" boxes that have 1/2" knockouts as that'll be easier to find the clamps. You fit a #10-32 ground screw on the hole at the little "bump", and pigtail that to the Romex cable grounds. If it's a "mud ring" then give yourself a 6" ground pigtail to nowhere, in case you ever get "non-self-grounding" GFCIs.
Grats, you are done with grounds. Push em into the back of the box and never think about em again! I love metal so much.
If it's a domed cover, you put hot+neutral pigtails onto the GFCIs and assemble them into the domed cover (in that order LOL). That's how I usually do things because it's easier assembling all that at a comfortable workbench. Remember do not add ground wires, the metal box/lid will do that for you.
If it's a drywall mud ring, then you finish the wiring, install the mud ring, drywall, then install the GFCIs like a normal outlet. Leave yourself a ground pigtail in case the GFCIs need it. You do not need ground wires if the GFCI has a "self-grounding" feature, which is a little brush that makes contact with the screw thread.
If it'll be unfinished for now and you'll do drywall someday, fit a domed cover now - a classier finished look, and no cover plates to snag your jacket. Change to a mud ring before you drywall.