It can be done, but it typically doesn't work out long-term due to the aggressive nature of the alligator gar; it's in the best interest of the gars to keep alligator gars separate from other gars. It's worth noting that you can easily mix the other Lepisosteus gars with each other without issues, and you can also mix Cuban gars and tropical gars with Lepisosteus gars under most circumstances although some caution is still needed.
I have kept the two species together in an aquarium when they're at a small size, but there were aggression issues from time to time. On the other hand, I currently am keeping two alligator gars with two longnose gars in a very large pond, and they actually swim together with no aggression that I have noticed.