At this age, little ones are very attention hungry. They love direct interaction, and if you are busy with something else, they can at times get frustrated that you're not interacting directly with them. Hitting is their way of saying "hey mom, I'm here you know!".
There's no simple solution to get me time without them getting frustrated, but they will understand that you need to do some tasks independently of them. Make up for it with some quality time together, tickles, crafts, making a big fuss with cuddles after you've finished, etc.
Try to avoid getting into battles with them as you'll both end up upset and exhausted. They grow out of it, but it's easy for them at this age to try to rule the roost. You're mom, you rock their world, and they need you! Good luck.