Laser dynamics in transversely inhomogeneous plasma and its relevance to wakefield acceleration