Different major versions of Ardour can be installed in parallel.
There is no need to uninstall Ardour 5 before installing Ardour6.
But, if you save a project in Ardour6, Ardour5 can no longer load it.
When you first open a project in A6 a backup of the session-file is automatically created in case you later want to use it in Ardour 5 again.
There are subtle differences, in particular Ardour 6 features latency compensation for Busses and Automation. An Ardour 5 project may sound slightly different in Ardour 6 for that reason, so you may even want to keep Ardour5 around if you have to export a project again.