First, the answer to your original question: since there cannot exist a right triangle with two right angles, when we talk about sin(pi/2) we are actually taking a limit. As x approaches pi/2, sin(x) becomes arbitrarily close to pi/2.
Now, your second question:
There are a number of equivalent definitions of sine and cosine independent of right triangles.
1) Draw the unit circle on a coordinate system. For non-negative t, starting at point (1, 0), measure counter-clockwise around the circumference of the circle. The point at distance t, around the circumference, from (1, 0) has coordinates (cos(t), sin(t)), by definition. Since the unit circle has circumference pi, pi/2 is 1/4 of the way around the circle, pi/2 takes us 1/4 of the way around the circumference to (0, 1). cos(pi/2)= 0, sin(pi/2)= 1. Notice that the x and y coordinates, and so cosine and sine can have negative values also. Going a distance "pi" around the circle takes us half way around, to the point (-1, 0): cos(pi)= -1, sin(pi)= 0.
That is the simplest way to define sin(t) and cos(t) but there are some technical difficulties with mathematically defining "measuring along the circumference". To avoid that, you could also:
2) Define sin(x) to be the power series
\sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)!} x^{2n+1}
and define cos(x) to be the power series
\sum_{n=0}^\infty \frac{(-1)^n}{(2n)!}x^{2n}
Or, my personal preference,
3) Define sine and cosine to be the solutions to given "initial value problems":
y(x)= sin(x) is the function satisfying the differential equation y"= -y, with initial values y(0)= 0, y'(0)= 1.
y(x)= cos(x) is the function satisfying the differential equation y"= -y, with initial values y(0)= 1, y'(0)= 0.
Another advantage of those definitions is that you can prove the most important property of sine and cosine, that they are "periodic" functions, which does not even make sense for the "right triangle" definitions where sine and cosine are not defined for all t.