Is there a way to know if the installed Android is official? I know that if one has access to the firmware files, one can check if the firmware is the official stock firmware or not by looking at the SHA1.

Now, suppose that Android has already been installed on the device. Is there a way to check whether or not the installed Android is the official stock version or not?

Maybe there's some information that can be found in another identical device running the same Android version that can be compared?
Look at the bootloader screen, there is a field that says Software Status, if it says "Official", well, then it's official. 

You can access the bootloader screen by powering off, then hold Vol Dn and Power until together until the screen appears.