Instead of going spelunking intoa dungeon or cave, you'll find the fossils in Pokemon Ultra Sun & Moon in a shop. Just head to KoniKoni City and look for the Stone Shop, which sells all manner of rare stones - including some handy fossils.