Yeah an UI can be pixel perfect. However the question is where it makes sense. For example things like border-radius, font-sizes, image / icons sizes, colors, line-heights etc. can and should be pixel perfect if you get a design.
But it gets tricky on things like margins and paddings if they are not good designed. By that I mean if the paddings and margins have weird numbers like 23px or if they are not consistent in the design.
However if then you could make it pixel perfect, but I would not, if I had to work with magic numbers.