You can replace any layer in the timeline that comes from a source in the Project Panel with a different layer by selecting the layer (footage, image, solid or nested composition) in the timeline, then select the new source file, which can be footage, an image, a solid, or anything in the Project Panel, holding down the Alt/Option key and dragging to the timeline. Every effect and animation that you have applied to the layer in the timeline will be unchanged, only the source file will change.
You cannot replace Text layers or Shape layers because there is no copy of the layer created in the Project panel when you add a shape or text layer.
You can always duplicate any layer in the Timeline or asset in the Project panel by selecting it and then pressing Ctrl/Cmnd + d. If you duplicate something in the Project panel you get a unique copy. If you duplicate a nested comp (pre-comp) in the timeline you do not make a unique copy of the pre-comp so anything you change in the pre-comp will change in all of the copies of that comp in your entire project.