So after running prime95 for at around 15 minutes at 100% load on all 4 cores one of the core temps reached 77,but it was mostly at 75 and other cores were at around 72 is this fine for a stock i5 2500 with a stock cooler?
Yes. That's Intels predicted temp range. You can do better of course if you buy an aftermarket cooler.
In general though anything under 80 is fine.
Over 80 you should start considering beefing up the cooling
Somewhere in the 90-100 range is when the CPU will start to throttle itself to keep temps in check and prevent any damage or unexpected shutdowns from happening.