I have read at some places that this is considered read-only and that it's dangerous.
String literals are indeed read-only.
Does that imply that the "test" is not allocated space in the heap?
Whether the space for the string is allocated is not specified by the standard. It's usually on the static section of the program, but the standard does not even mention things as the heap.
Does that mean that the string "test" can be written over later in the program?
Writing over the string is undefined behavior.