You should indicate the name of the package you want to remove: RUN dpkg -r tar. However, it is not certain that this will remove the same version of the deb file.
RUN dpkg -r tar
deb