The British did encounter elephants, but they weren't really used in a "combat role" but they were more used as a platform by Indian commanders to look over the battlefield and give orders. Jos Gommans' book "Mughal Warfare" explains the use of elephants in combat really well:
Much earlier, from the eleventh to thirteenth centuries onwards, the horse-archers of Islam had already driven the elephant from its pre-eminent military position – at least in those parts of India that were conquered by the Turks.124 But there also seems to have been a remarkable revival of the war-elephant during the sixteenth century, as large numbers of elephants appeared, not only in the Indo-Afghan armies of Hemu at Panipat (1556) and Da’ud Karrani at Tukaroi (1575),125 but also in the Mughal army under Akbar.126 It was only under Akbar’s successors that their numbers fell off again and that they almost disappeared from the front line of battle. At this stage, they mainly served as high platforms from where the commanding generals could watch, and be watched from, the battle scene. Obviously, the visibility of the commander was of the utmost importance for his troops. If he was killed or, more frequently, just disappeared, the army lost its employer and, in no time, all fighting men left the battle scene and the battle was lost, the more so because Indian armies were often held together by a precarious network of temporary alliances, often culminating in just one man
One instance in which the British encountered elephants was at the battle of Plassey. A bit of background for those who are unaware, in the mid 1750's the Europeans (specifically the British and the French) began vying for influence in India. The British East India company and the French East India company began fighting a proxy war. In June of 1756 the French backed ruler of Bengal (named Siraj-ud-Daula) invaded British territory and captured the important trading port of Calcutta. Naturally the British responded, and Calcutta was retaken in January 1757. But the British under the famous Robert Clive still needed to destroy the ruler of Bengal's army. Clive advanced towards Daula's capital and the two sides met at the village of Plassey.
Now the British were outnumbered in this case, they only had 850 British regulars and about 2000 Sepoys, with about 10 artillery pieces. The Indian army numbered about 50,000. A mid battle rain neutralized the Indian artillery, which allowed the small amount of British artillery to go to work decimating the India army. They focused especially on the commanders. The British artillery shot at the elephants and it caused the them to go wild and begin stampeding over their own lines, crushing anything or anyone in there path. War elephants would have been used to the gun powder and the very loud sounds because pretty every Indian ruler had adopted gunpowder weapons. What most likely caused the elephants to lose control, was the proximity of the artillery pieces, they were used to the sounds, but training elephants to become used to artillery shells landing right beside them was pretty difficult. The vast majority of British soldiers were Sepoys, who obviously wouldn't have been shocked by elephants. As for the British regulars, I can't say for certain, but I doubt they were too shocked. The soldiers would have heard stories, both in India and in Europe, and the British weren't really getting to up close and personal with the elephants, so I doubt it was much of an issue. This painting depicting Robert Clive with one of the Indian commanders after the battle of Plassey shows British soldiers in close proximity to elephants, so that indicates that they obviously weren't too frightened by the animals.
Sources:
"The Rise and Fall of the British Empire" by Lawrence James
"Mughal Warfare" by Jos Gommans
"Britain as a military power" Jeremy Black