Generate structures on procedurally generated terrain

So I have made an infinite procedurally generated terrain with trees, rocks, mountains and stuff, but now I want to generate buildings. Can I do that with the help of perlin noise and is it similar to generating trees?

I also want to spawn a building at a random position that is like for example about 20 units away from the spawn position, how can I do that and so that the building spawns on a pretty flat area?

Yes, It is like generating trees but structures. as for the second question i don’t know. sorry