A little bit of clarification on the use of elephants in warfare:
Elephants and camels were initially used to frighten cavalry, since the horses were unfamiliar with them and wouldn't go anywhere near them. Once the armies encountered them, they started raising a few of their own to get their horses familiar with the sight. Problem solved.
Elephants were also potentially useful for disrupting a battle line, but there were a few complications. The elephants were initially controllable, but once they took injury, they tended to try to escape. If no visible escape path was available, they then tended to crash through the lines with a lot of carnage. The danger was that the elephants might turn around to escape, and then crash through your own lines, so the handlers were typically provided with spikes and mallets to sever the spinal cords of the elephants before that "worst case" situation occurred. After a few generations of such warfare (during the wars of Alexander's successors), infantry started practicing opening lanes through their ranks for the elephants to pass through, which the elephants were more than happy to make use of. At that point, the use of elephants on the battlefield became far less successful.
Meanwhile, the use of African Forest elephants in warfare resulted in them being captured and removed from their habitat to the point of extinction. Various cultures tried taming the larger and more aggressive African Plains elephants, but that proved impossible except with young and barely useful specimens. The Indian elephants didn't have the temperament to attack, and simply ran away at the first excuse, again making them relatively useless in combat except as a moving archery platform.
Caesar apparently brought a small number of elephants and camels to the British Isles, because the native troops had never encountered them before, and their horses were terrified of them. They had long ceased to be practical on the field of battle elsewhere in the West, although they continued in use as mobile archery platforms in the East up until only a couple of centuries ago, and as "military engineering vehicles" for heavy lifting into the 20th Century.