My concern is that the actual one (700x23) is quite close to my brake (about 3 mm). It's safe for me to buy a 700x25 or 700x28? I would like to have a slightly wider tires.
How much space do I need between my tire and brakes to change from 700x23 to 700x25 or 700x28 tires?
In the situation under question when going to a wider tire you need to worry about brake and frame / fork clearance.
In a perfect world you would have 1mm clearance on your brake if you installed a 700x25 tire.
However, different tires may be slightly wider than 700x25 and some tires are a little out of round. So, it depends.
Also, we don't know how much frame clearance you have.
The only way to know for sure is to try the tire on your bike. Don't assume that if a tire works on the back it will work on the front - you have to check both. When clearance is tight it's important to test ride on the wider tires. Wheels will flex (some more than others) and the frame may flex so the tire may rub when riding (especially when pedaling hard) even if they don't rub on the bike stand.
How much space...
If the tires clear - all the way around (to clarify "clear" means your wheels rotate freely given frame/wheel flex and any riding condition, mud, asphalt you encounter) when riding - then all is good. There is no minimum amount of space needed if bicycle flex and environment are accounted for.
From experience, I was able to replace a 700x23 tire on the back with a 700x25, but not on the front. The front 700x25 tire cleared the brake but rubbed on the bottom of the fork crown.
A quick Google will tell you that there is a debate as to how much going from 23 to 25 matters and if the difference can be felt. Depending on your sensitivity it may not be worth changing.
It might be time to look into getting a bike designed to use wider tires. A test ride at your local bike shop would inform your thinking.
WRT the photo - I'd be quite confident you can fit a 25mm in there without issue.
A 28mm looks like it would probably fit acceptably, but I doubt a 32 mm would fit.
The best solution here is to take your bike to a Local Bike Shop, and buy your 28mm tyre/tube from there, on the provisio if it doesn't fit on either end you simply swap it for a 25mm.
Second option is to buy the tyre you want, and if it doesn't fit then sell it on ebay/local auction website, but you'll probably take a hit on the value.
Remember, you need to look at chainstay/seatstay clearances at the back, fork clearances at the front, and brake caliper clearances at both ends of the bike.
The other thing that may hold you back on tyre width is rim internal width. The wider tyres prefer to sit on wider rims. A 23mm tyre should be on a rim with a width of 13-17mm. A 28mm tyre wants to be on a rim from 15-21mm. More info at What is the maximum or minimum tire width I can fit on my bicycle Though do note these numbers are somewhat fuzzy edges.
Relevant thoughts - wider tyres do make it harder to drop the wheel through the brake pads. You may need to change your methods, by only inflating the tyre once the wheel is installed in the bike. Or you may have to look at how to get slack in your brake cable with a quick release or similar. Not a problem, but it can be frustrating to have to deflate a freshly inflated tyre to get the wheel through the brakes. More-so if you just used your last cartridge, or have to do it with a minipump (perhaps again!)
Your brake pads should not be touching your tires. If they are touching, you need to reposition the pads immediately so that they contact the rim sidewalls.
The only time this should be a concern is when you are installing or removing a wheel (when fixing a flat, for example). Brakes normally have a release that opens up the brake arms to accommodate the tire for this purpose—the release is either a small lever on the brake arms, or a pin on the brake levers. An extra 5 mm should not be a problem when the release is open.
If you are already riding around with the release open, use the brake's barrel adjuster to loosen the brakes so that the pads are correctly positioned with the release closed. If you need more adjustment than that, you'll need to loosen the cable fixing bolt on the brake arm and let some slack into the cable that way.
Another possible concern is that the larger tires will rub on your frame, although it would need to have extremely tight geometry for 5 mm to make a difference.