I have a 18mm -55-mm 'kit' lens with my Nikon D40. Is it effective as using a 24mm true wide angle lens for indoor real estate photography?
As stated in other answers, many architectural shooters will use a Tilt-Shift lens in order to get straight lines done in camera. Or, for a crop sensor camera, a 10-20mm zoom gives you super wide angles to wide angle in available focal length.
But, if we limit things to just your 18-55 and the 24mm prime...
Is it as effective as using a 24mm true wide angle lens for indoor real estate photography?
First up, 24mm is 24mm. Using your 18-55 set to 24mm will give the same field of view as using the 24mm lens. There exist differences between the two lenses, of course, like available aperture to use, sharpness, chromatic aberration, etc.
But, if we just look at the composed photo, they'd be the same.
The only reason that you should consider a lens like a 24mm prime, one that duplicates a focal length already in your bag, is if those other attributes are needed (more open aperture, sharper, less CA, etc). Given that, for architecture, you can use a tripod...many of the benefits of the 24mm prime will be negated.
But, let's say that it did have some benefit. The next question is do you even use that focal length?
Go back though your images and check the EXIF data - which focal lengths do you use the most? If you are at the 18mm end most often, and also finding that you wish you could shoot wider or are doing panos/stitching images...then there would be no reason at all to get a 24mm.
A note on lens acquisition...if possible, try before you buy by renting or borrowing.
A general path is to expand the focal lengths that you can capture instead of simply upgrading or duplicating focal lengths with primes.
For example, a common kit is 18-55mm, 55-250mm, and a 50mm f/1.8 prime. Why was the prime thrown in when you already have two lenses around that 50mm range? Because of the much more open aperture; in low light, it'll be the only lens you have available for most things.
Your kit has an 18-55 and you do real estate/architecture photography...it would make more sense to get a 10-20mm lens to expand your focal length range than to get anything in the 18 to 55 space that happens to be just a little sharper, just a little less CA, etc.
No, you'll find you'll need a much, much wider lense for indoor photography. Real estate sells because it's roomy. You need at least 16mm, and possibly as low as 10mm on a 1.6x crop factor camera.
You'll also want to condider purchasing or getting good at 'stitching' panos to create wider areas of your room. Yes, it'll distort the room some, but people are used to it.
Source: Used to do it. Did Panos when Panos were 'cool'. Did VR 360s when that was 'how did you do that'.
For architecture photography, people tend to prefer tilt-shift lenses because they can reproduce straight lines more easily - see Wikipedia for more details. You should be able to compensate for lens distortion - which will cause vertical walls to appear curved or "bendy" - that in post with the right lens profile corrections applied, but it is another step compared to "take picture". For real-estate photography, you have a good impetus to do some post work, but have to also keep in mind not to remove blemishes or change colors around too much.
Adobe Lightroom makes that pretty easy to apply to many pictures.
It doesn't matter which lens you use. Both offer 24mm. However, on your camera, neither will produce 35mm-equivalent 24mm field of view: both will provide the equivalent of 24 x 1.5 = 36mm. This is because the sensor is smaller than 'full frame' 35mm film negative equivalent.
So in fact, the 18mm zoom on your kit lens will be wider than the 24mm prime lens you are considering (27mm vs 36mm crop equivalent). The quality of the image will be arguably better on the prime lens but that likely will not override the wider field of view provided by the 18mm end of your zoom.