The simplest example is to think about the earth. Start at the north pole and draw a line segment down to the equator. From there, draw the second line segment by travelling along the equator for one-quarter of the distance around the world. Draw the third side of the triangle by going back up to the north pole. The triangle you just drew will have three $90^\circ$ angles, for a total of $270^\circ$. This does not violate the $180^\circ$ rule because the triangle was not drawn in a flat plane.
Why is the angle sum greater than $180^\circ$? Because being on the surface of a sphere makes the angles "bulge" a bit. It can be shown that the angle sum of triangles on a sphere will always be greater than $180^\circ$. The amount that the angle sum is greater than $180^\circ$ is called the **defect** of the triangle. You might be suprised to know that the defect of a triangle drawn on a sphere is proportional to the surface area of that triangle.