SecondLife/Opensim uses Primitives to construct models. How it works in details is explained here.
Now I have many triangles which link together. Is there any way to make them into one prim, thus reducing the number of prims?
No. A "prim" is a primative object, and is the base building blocks for building 3d content.
You cannot combine shapes into a single prim.
However you can use prims efficiently by using clever textures instead of details, or by using fewer larger prims to create your objects.