Yes you can do both. RAM stands for random access memory, that that means you can read it or write to it at random. That is different from ROM in which it is only made to be read, but not written to.
To be technical, the user doesn't exactly write to RAM, but the CPU and/or the DMA controller does. In assembly code, a programmer asks the CPU to move data from memory to the CPU, or from the CPU to memory.