No, you cannot directly change the Dockerfile of a running container. Docker containers are created from images built from Dockerfile, the Dockerfile itself is not part of the container once it is running.
If you want to change the environment or behavior of the running container, you will need to make changes to the Dockerfile and build a new image, then recreate and replace the running container with a new container from the new image.
It is also possible to commit the changes made in a running container to a new image and then run new containers from this new image. However, this goes against the principles of the image being the blueprint for the container, and it is recommended to make changes in the Dockerfile and rebuild the image.