Axolotls are not a social species, so they don’t need a friend to be entertained. That being said, it is perfectly ok to house axolotls together, as long as they are roughly the same size. If one axolotl easily fits into the other’s mouth, chances are it will end up as a snack. Usually, axolotls grow out of their cannibalistic phase once all four limbs are formed, but some unfortunately retain those instincts. If space is very limited, you might see some snapping behavior at feeding time, which can lead to injuries. In addition, if your axolotls are not adequately fed, they may eat each other’s limbs for extra nutrition. Those limbs will grow back, but do your best to limit altercations by feeding them a nutritious diet and keeping them in proper housing conditions.
Keep in mind that if you house a male and a female together, they will most likely end up breeding. The young larvae are not that easy to care for, so make sure you know what you’re getting into before you choose to attempt it!