Why are there nails only half way in, in my garage?
People were using them to secure things or hang things on.  They serve no purpose.  I would just pull them out since hammering them in probably will not be that easy.  You might want to get a small board to press against so you do no damage drywall.
Also FYI I do not think the drywall that is currently on there is going to take pain - even primer - that well.