Is it safe to ride this frame?
If it's an aluminium frame it's fine. The dent is relatively small on a large diameter tube so will not affect frame integrity.

I guess you just bought the frame used. If you bought it in person you should really have checked for damage before making the trade. If it was bought online and the dent was not mentioned in the ad you technically have a reason to return it the seller and get a refund. If used a site like Craiglist you'll have to negotiate with the seller, if a site like Ebay you can use their dispute resolution tools.

In any case it's fine. If and when you crash on this frame at least you won't feel so bad about putting scratches or small dents on it.