When building a RAMPS 1.4 based printer, can I safely plugin just some of the components to test if they are working?
If by components you mean motors, fans, or heated bed, then yes. This is even suggested in the Final Setup instructions on the RAMPS wiki.


  If you think you may have mistakes (in your setup) you can install only one stepper driver during initial testing and risk only one stepper driver.


There are also printers using RAMPS with no heated bed and other machines that have no extruder at all. Furthermore, from an electronics perspective: if nothing is connected across a terminal no current will flow and therefore there is no damage that can be done. Obviously if you short out the unused connections there will be problems.