if its just a small dot on/inside lens, will not show in photo.
to confirm its sensor, change to another lens, take a full frame shot of a single light color surface (white should be best), check and see if the dots is still there in a same position.