Which one has a better recoil? How many bullets does each clip hold? What can you attach to these weapons? Do the differences between these weapons make one better-suited for one situation compared to the other?
Seeing as how you've tagged this for MW3, I'll assume that it's the game we're talking about. Recoil is something that you'll really just have to use the guns for and figure out which you think is better, most of the assault rifles don't vary too much. As for the bullets in a mag, the M4A1 holds 30, as does the AK47. The differences aren't huge enough to make them any better suited, save perhaps a small difference in rate of fire. I would recommend MW3 Wikia for you to peruse as it has the stats of every gun from all of the games, and you'd find your answers much more quickly.
Both hold 30 rounds. Neither is "more accurate", or at least, not on the first shot. The AK47 does have significantly more recoil. M4A1's fire rate is 780 rpm, while the AK's is 689 rpm. The M4A1 inflicts 42 damage in its range and 20 out of it. The AK47 will deal 49 damage within its range and 25 damage out of it. This gives the AK47 a longer effective 3-hit kill range; however, as both will kill in 3 hits to the body or 1 headshot and 1 bodyshot (2 headshots also work, of course), the M4A1 is superior within its range. Note that the M4A1 also has a quicker reload.
M4A1 and AK47 - Weapon Attachments
Red Dot Sight Unlocked at Weapon level 2.
Do the differences between these weapons make one better-suited for one situation compared to the other?