It's fine to install on two different machines (provided you own both of them, of course), but Apple has a built-in protection mechanism that prevents you from operating Logic on both machines at the same time.
I do exactly this. I have Logic on my main Mac in the studio, but also have it installed on my MacBook for the occasional on-location recording. I just can't have Logic running "live" on both computers simultaneously.