Does DFT produces the same output as FFT?
Yes it does but your DFT implementation is wrong. w1,w2,n1 and n2 should be in the range of $0, \ldots, N-1$.  Also you should be comparing against MATLAB's fft2 function.

Here is a correct implementation. I've replace w1,w2 with u,v and n1,n2 with x,y to follow conventions.  I've done some algebraic simplification.

I = [255, 255, 30, 100 
    255, 50, 90, 20 
    70, 70, 20, 10 
    100, 20, 10, 0];

% it converts it to grayscale
I = mat2gray(I);

% DFT
N = size(I,1);
IDFT = 1i*zeros(N,N);
for u=0:N-1
  for v=0:N-1
      DFT = 0;
      for x=0:N-1
          for y=0:N-1
              DFT = DFT + I(x+1,y+1)*exp(-1i*2*pi*(u*x+v*y)/N);
          end
      end
      IDFT(u+1, v+1) = DFT;
    end
end

IDFT
fft2(I)

IDFT =
5.3137 + 0.0000i   2.0784 - 1.0392i   1.1961 - 0.0000i   2.0784 + 1.0392i
1.8431 - 1.1176i   0.6471 - 0.6667i  -0.3137 - 0.7255i   0.7255 + 0.0784i
1.0392 - 0.0000i   0.0784 - 0.6471i  -1.6667 - 0.0000i   0.0784 + 0.6471i
1.8431 + 1.1176i   0.7255 - 0.0784i  -0.3137 + 0.7255i   0.6471 + 0.6667i


MATLAB_fft =
5.3137 + 0.0000i   2.0784 - 1.0392i   1.1961 + 0.0000i   2.0784 + 1.0392i
1.8431 - 1.1176i   0.6471 - 0.6667i  -0.3137 - 0.7255i   0.7255 + 0.0784i
1.0392 + 0.0000i   0.0784 - 0.6471i  -1.6667 + 0.0000i   0.0784 + 0.6471i
1.8431 + 1.1176i   0.7255 - 0.0784i  -0.3137 + 0.7255i   0.6471 + 0.6667i