In short, yes! You can use GIFs inside H5P. All you have to do is create a content type that lets you add images, then insert the GIF by clicking on add file and selecting it from your library.
Here's an example of what you can create:
These are also some of the other formats compatible with H5P: