It looks like brick, but you need to be sure, at least that it is solid & of sufficient depth/thickness to be drilled double-depth.
Cosmetically, most of that damage will be hidden when you put the rail back up, so you can fill it with anything - Polyfilla is a common brand name in the UK - but 'general purpose indoor filler' will get you something similar. Paint afterwards if you can still see any of the repaired area, with the rail up.
The bottom two holes are probably re-usable as they are, but the top needs attention. The top gets all the leverage force of the curtain itself, plus any pulling as you open/close them.
I'd have mounted the brackets the other way up to spread the force over two screws rather than one, but if you don't want to re-do the entire structure you need to strengthen the top fixing.
On the fixture that came off, you have three screws & one of the rawlplugs. It's hard to tell scale from the photo, but brown plugs are usually the largest commonly-available.
Your approach has to be two-fold. Repair the existing hole but make it tougher in future. Ideally, you want the hole drilled to twice the depth & insert two plugs one behind the other. You then need a screw the same gauge [or the largest that will fit the existing hole through the fixture] but twice the length, so it goes right to the back of the farthest plug.
Once you re-drill, inject the hole with some strong, hard-drying DIY/builder's adhesive - they go by brand names such as 'no more nails'. Insert both plugs & leave overnight to cure.
As you're going to all that effort for one hole, you really should apply the same procedure to the other two - & the other end of the rail too.
If you want 'double-protection' re-drill all the holes & set the fixtures the other way up, so you're not re-using holes & also getting the double screw to the top where the whole thing will be stronger.
To size everything up, take one of the screws, plugs & the fixture if it's portable. You could also take a bit of the 'brick' that's chipped off to get a second opinion on what it's made of. Tell the retailer this plan [print it or save it on your phone, along with your picture] & let them select appropriate components.
BTW, none of this is 'how a builder would do it'. This is Victorian house repair DIY 101 - where things need to be put back in places where the substrate is of uncertain quality & you don't want to have to take half the wall down to fix it 'good as new'.