Does the law of crosscutting relationships involve sedimentary rock only?
No the law of cross cutting relates to all somewhat horizontal
The law of cross cutting is the logical assumption that a magma protrusion that cuts through horizontal layers at a diagonal or vertical is younger than the layers that it cuts through.
Sedimentary rocks are most often found in horizontal or near horizontal layers or strata. Therefore cross cutting can be used most often in the relative dating of sedimentary rocks.
However lava flows also form horizontal layers of rock. Pumice ash can be laid down in horizontal layers. A magma protrusion can also be used to relative date igneous layers of rock.