Can I remove a docker image and still keep the container?
There are 2 really major points for Docker containers. 


You make sure the app dependencies are versioned and encapsulated
inside the container. Container runs smoothly eveywhere, as long as you have the Docker daemon.
You have the capability to create/destroy a
container on any time, also known as ephemeral property. You could test easily, maintain N of them if needed ( Replica Sets in K8S for example are doing just that, Docker Swarm uses services to maintain this number as well ).


The official Docker docs defines an image as


  An image is a read-only template with instructions for creating a
  Docker container


You can't remove an image, because the container relies on it. 

docker image rm ubuntu:20.04
Error response from daemon: conflict: unable to remove repository reference "ubuntu:20.04" (must force) - container ecd06b4eb4bf is using its referenced image


Then you might force the process

 docker image rm -f ubuntu:20.04
Untagged: ubuntu:20.04
Untagged: ubuntu@sha256:747d2dbbaaee995098c9792d99bd333c6783ce56150d1b11e333bbceed5c54d7
Untagged: ubuntu@sha256:8bce67040cd0ae39e0beb55bcb976a824d9966d2ac8d2e4bf6119b45505cee64


But that just untags the image, it's still here.

docker image ls
REPOSITORY             TAG                                        IMAGE ID            CREATED             SIZE
&lt;none&gt;                 &lt;none&gt;                                     1d622ef86b13        3 weeks ago         73.9MB


So to your question, the best practice is to only remove images that are not being used by any containers. If you maintain 2-5 versions of your app, you could safely remove the others. Also you schould strive for minimum size of each image, even in total that schould not bother your available space that much.