what exactly does the rasterizer outputs as per my knowlage it outputs primitives rasterized as fragments which seems correct as the next step in vulkan/opengl is fragment shader but dx confuses me here because there the step after rasterization is pixel shader.Is it just a convention for dx to call it pixel shader even though it runs per fragment or is my understanding incorrect that rasterizer outputs fragments.Also what is the size of a fragment?
You are correct in your understanding that the rasterizer produces fragments. Each fragment can be thought of as a quasi-pixel, in that geometry may generate more than one fragment for the same pixel (such as in multisampling). The pixel shader's job is to take those fragments and compute lighting, color, etc., to produce the final pixel that gets written to the target buffer.
In essence: Vertex Shader -> Rasterizer -> Fragment -> Pixel Shader -> Pixel
In general, a rasterizer converts a vector description of an image to a raster description, like converting (centerx centery radius color) to a bitmap of a shaded circle. Literally, the rasters are the rakes (unrelated implement named from the same Latin root) or scanlines of the image, so they might be interally represented as rows of a bitmap or a run-length encoding or a set of cooefficients for a fourier transform or something.
The process can be considered as projecting the scanlines backwards into the model space and detecting where these lines intersect with the boundaries of objects. A distributed shader might produce a small bitmap or a few scanlines which must be reintegrated to produce the full image.
In a finer-grained setting, the rasterizer could be isolated to just detecting the edges of objects and then call the pixel shader for the smaller range of the scanline where it's actually inside of the object.