That is basically the whole purpose of having pointers: you can change the values contained at a location in memory, and you can share the same pointer between different pieces of code.
In C, you can make a pointer to almost anything, and then pass that pointer to another function so that the other function can modify the object the pointer points to. Whew, that's a mouthful. C and C++ are fairly unusual in letting you make pointers so freely, many other languages have tight restrictions on what pointers can point to. Java, for example, only allows pointers to point to object instances, and you can't do pointer arithmetic. (Yes, Java has pointers.)
And yes, it is "dangerous", in the sense that it's easy to write incorrect programs that misuse pointers. Dangling pointers, buffer overflows, null pointer dereferencing, and many other types of programming errors are possible in C because of the way pointers work. If you're lucky, your program will crash and you can debug it. If you're unlucky, it won't crash.
The danger in using pointers is one of the primary motivations between other languages such as Java, things like std::unique_ptr<>
in C++, C#, Rust, Go, etc. If you are writing C, you just have to be careful. So, why use C? Sometimes, you need to use those pointers and scribble over memory however you want. The Linux kernel is mostly written in C, and plenty of language runtimes are at least partially written in C (I know this applies at least to Python, Java, and Go).
People still write in assembly language, too. Sometimes even C doesn't let you do what you need.