Yes, a 3-gallon air compressor can run a nail gun, but it may have some limitations depending on the type and size of the nail gun and the nature of the job. A 3-gallon air compressor typically provides around 0.5 to 0.7 CFM (cubic feet per minute) of airflow, which may be enough for smaller or intermittent jobs with a finish nailer or a brad nailer. However, a larger air compressor with a higher CFM rating may be required for larger jobs requiring a framing or roofing nailer.