Select the gif you want to open and press the Space key. This will open a built-in Preview window in Finder and the gif will be played.
There is an app that will allow you to play animated gifs without using your browser or the Preview feature.
Step 1: Download and install Xee.
Step 2: Right-click on one animated gif and choose Get Info.
Step 3: Scroll down and change the Open with... section to Xee from the drop-down menu.