Go out to YouTube. Look up eldon226. He has several videos out there in bar top builds that he shows off both trackball and light guns with a pi3 working. I know it can be done, but how is the question. I think I sent him a message before in the past asking about the track ball but I don't think he ever got back to me. However, search through the comments as I think there were more answers about the light guns though.
I downloaded a blank copy of motion blue v5 this weekend to start my new build. When I burn the image, I may only put on a hand full of roms in mame, one at least being a track ball game before I go and load it all up.