Take a look at BrickIt, a script for Maya that will allow you to build Lego models.
There are many useful scripts and plugins for Maya that make the tool all the better but this one might be the most interesting one there is. Meet BrickIt, a script for Maya that will allow you to have an infinite box of Legos to play. The script was created by CG Artist Romain Chauliac, a.k.a. - Wizix - and the Tumbler project seen in the video above showcases the capabilities of the script.
BrickIt is only working on Maya 2018 and higher for Windows, macOS, and Linux. You need to have at least Arnold Mtoa 3.1.1. For Maya 2022 there is a full Python3 version. The project is constantly updated and the author keeps adding new bricks for everyone to play with.