Do you mean for the robot to be placed at the start of a maze, and drive around recording where the walls are? If so, then yes, this should be quite easily accomplished. Maybe the robot could use a wavefront algorith
to work out where it needs to be.
Also, how about staring with bog-standard maze solving code, and adapt it so it records where it finds walls. There are so many ways you could do this, that it would really help if you expanded your idea