I want to update my Python framework on Mac and delete the old versions but I am not sure if is safe to
rm -fr /Library/Frameworks/Python.framework/Versions
No, it's not safe. Generally, don't mess with the Python that comes with your OS, many system tools depends on having a specific version of Python.
Yes, it's safe.
The Mac's system python's are in /System/Library/...
.
.dmg's downloaded and installed from python.org are placed in /Library/...
.
Don't delete the /System ones, but the /Library ones are user installed, so they should be safe to delete.