M.2 slots can work with all kinds of modules; it just happens that SSDs are by far the most popular.