In some forms of coal a metamorphic rock fossils have been formed.
There have been fossil footprints found in volcanic ash, an igneous rock
However almost all fossils are found in sedimentary rocks. Sediments cover the remains of living things as they are buried by water erosion and wind blown sand. This preserves the remains of living things so that the remains can become fossils.
In metamorphic rocks the heat and pressure tends to destroy what ever fossil remains were contained in the rocks. For example in subduction zones ocean sediments containing fossils are pushed underneath the continental plates. The fossil bearing ocean plates are melted as they are pushed under the continental plates.
Igneous rocks are formed by heat and fire. The heat would melt and destroy most fossils.