How to get an object's position in screen space in pixel shader?

That's the position of the object itself, not the pixel being drawn.

Thanks in advance.

Do you mean the position of object's origin (i.e. (0,0,0) in object's local coordinates)?

#include "UnityCG.cginc"
// [...]

// get clip space coords of the origin:
//float4 p = mul (UNITY_MATRIX_MVP, float4(0,0,0,1));
float4 p = UNITY_MATRIX_MVP[3]; // equivalent to commented line above but without actual multiplication

// get screen coords from clip space coords:
p.xy /= p.w;

After that `p.xy` is object's screen coordinates (from -1.0 to 1.0). You may also convert to pixels if you care:

p.xy = 0.5*(p.xy+1.0) * _ScreenParams.xy;

You can take translation part of UNITY_MATRIX_MV (or one of these matrices) - it contains position of the mesh being draw. Otherwise you'll have to pass it as param to the shader.