Hi-
AFNI I/Os BRIK/HEAD format, as well as NIFTIs. If you would like the output to be a NIFTI file, then just include that extension in the output file prefix, such as:
3dLocalstat -nbhd 'SPHERE(3)' -stat mean -automask -prefix DSET_OUTPUT.nii.gz DSET_INPUT
Just to note, there are some useful getting-to-know-AFNI and general MRI/FMRI analysis teaching materials here:
https://www.youtube.com/c/afnibootcamp
... and here:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/educational/main_toc.html
--pt