I am trying to install latte dock in dom [...] I downloaded the new version from GitHub but don't know how to install the install.sh,
I assume you understand the security implications of this?
If you are actually at risk: don't do this! Do not modify, install or reconfigure anything in dom0 unless you are 100% sure of what you are doing and what effects this has on your security.
If you just want to tinker and learn ... have at it. 
I am always getting an error that cxx compiler path not found or
that libQtcore.5.so (64 bi) cannot found, but it is installed.
That's because the install bash script attempts to actually build the
binary and you don't have the compiler or the respective Qt dev packages
installed.
Dom0 in R4.0 is based on Fedora 25, so could try to follow the
instructions for Fedora from
You'd have to call qubes-dom0-update instead like so:
sudo qubes-dom0-update cmake extra-cmake-modules qt5-qtdeclarative-devel
qt5-qtx11extras-devel kf5-kiconthemes-devel kf5-plasma-devel
kf5-kwindowsystem-devel kf5-kdeclarative-devel kf5-kxmlgui-devel
kf5-kactivities-devel gcc-c++ gcc xcb-util-devel kf5-kwayland-devel git
gettext kf5-karchive-devel kf5-knotifications-devel libSM-devel
kf5-kcrash-devel kf5-knewstuff-devel kf5-kdbusaddons-devel
kf5-kxmlgui-devel kf5-kglobalaccel-devel kf5-kio-devel
Once you have all this in place, you could run install.sh again and it
should work now.
Maybe there is a solution that I temporarily can enable network access
in dom0, that I can try to install it via the KDE GUI or I need to do
some changes at the cmakelist.txt.
No there is no way I am aware of to "temporarily enable network access in dom0" -- it also goes against everything Qubes OS is trying to accomplish.
PS: Maybe it is possible to update it in the qubes repo, that I just can install it from there?
R4.1 should be based on a much newer Fedora version. I believe Fedora 32 maybe? ... in any case I have seen posts here indicating that KDE in general might run better in R4.1 -- so if this is all fun and games and you don't rely on your machine for serious work, you might want to try the Alpha version.
/Sven