Yes, fungal nail infections are contagious, and they can spread quite easily between people who live in close quarters.
It can also spread in warm, damp environments like communal showers, gyms, public swimming pools and changing rooms.