That's right. Historically, nebula was anything that looked cloudy, so a lot of astrophysical objects that we now understand are distinct, were simply labelled as nebulous. M31, as you said, being a great example.
Modern astrophysics still carries the baggage of obsolete terminology to this day, from names of objects to names of units.