Consider two coordinate system $C_1$ and $C_2$. There are three points $p^1_1 $, $p^1_2$, and $p^1_3$ in coordinate $C_1$, where these points have $p^2_1$, $p^2_2$ and $p^2_3$ values in coordinate $C_2$. (note: $p^i_j \in R^3$)
How can I find the transformation $T$ (in the form of $T=[R\hspace{0.2cm} t;0\hspace{0.2cm} 0\hspace{0.2cm} 0\hspace{0.2cm} 1]$ where $R$ is rotation matrix and $t$ is the translation vector) between these two coordinates such that for an arbitrary point in coordinate one like $p^1_4$, I can find it's value in coordinate two $p^2_4$ using $p^2_4 = T * P^1_4$.
Note1: I have used (Iterative Closest Point) ICP two find transformation between these two set of points. The computed transformation is correct for $p^2_1 = T * P^1_1$, $p^2_2 = T * P^1_2$ and $p^2_3 = T * P^1_3$. However for an arbitrary point $P^1_4$ the relation doesn't hold i.e $P^2_4 \neq T*P^1_4$.
Note 2: My points are as follows: $P^1_1=[51.2,-206.6,1894.3]; P^1_2=[51.4, -157.6, 1893.6]; P^1_3=[-48.8, -206.6, 1894.2];$ $P^2_1=[-112.087, 181.788, 989]; P^2_2=[-115.62, 230.3, 987]; P^2_3=[-215.696, 185.55, 989];$
I expect to obtain transformation that the rotation part is close to identity matrix and it's just translation.
You cannot find "the transformation between the coordinates" because no unique transformation exists.
Example: in 3-space, let $p^1_1 = (0,0,0), p^1_1 = (1,0,0), p^1_2 = (0,1,0)$. Let $p^2_i = p^1_i$ for $i = 1 , 2, 3$.
Then the identity map takes $p^1_i$ to $p^2_i$ for every $i$. But so does the map defined by
$$T(x,y,z) = (x, y, 17z)$$
because your coordinate frames tell us nothing about the $z$ coordinate.
This phenomenon isn't a fluke: an affine coordinate system with only three points doesn't suffice to generate coordinates on all of 3-space --- only on a 2D subspace. So when you find a mapping that takes one of your coordinate frames to the other, points outside the 2D subspace of the domain that the coordinates apply to can be sent anywhere. You need affine coordinate frames with four points (no three of which lie in a single plane); then uniqueness is easy.