If Google is to be believed, the Nexus 7 (2012) and the Galaxy Nexus are not powerful enough to run Android 6.0 Marshmallow. While the 2012 Nexus 7 received the Lollipop update, Google stopped supporting the Galaxy Nexus after rolling out the Android 4.3 Jelly Bean update for it.
However, this has not stopped the talented developers over at XDA forums from porting Marshmallow to the devices. The ROM for the Galaxy Nexus has been made by developer Ziyan and is called ‘ZMoD’, while the one for the Nexus 7 (2012) is made by developer dmitrygr. Owners of 3G variant of the Nexus 7 (2012) are out of luck though, since the ROM only supports the Wi-Fi variant. Both ROMs require that the bootloader of your Nexus is already unlocked with the very latest version of TWRP recovery installed.
While the ROMs work without any issues, they are not exactly super smooth or stable. Due to the limited amount of RAM on both devices, there is a notable performance issue, especially when running multiple apps at the same time. Nonetheless, if you are really keen in trying out Android 6.0 on your good old Nexus device, the above custom ROMs are your best bet.
Download Android 6.0 ROM: Galaxy Nexus | Nexus 7 (2012)