We investigate a connection between random walks and nonlinear diffusion equations within the framework proposed by Einstein to explain the Brownian motion. We show here how to properly modify such framework in order to handle different physical scenarios. We obtain solutions for nonlinear diffusion equations by using the random walk approach and possible connections with a generalized thermostatistics formalism. Finally, we conclude that fractal and fractional derivatives may emerge in the context of nonlinear diffusion equations, depending on the choice of distribution functions related to the spreading of systems.