The choice between "at" and "in" is often linked to how you conceive the location described. You are correct to assume that "in" is more specific than "at".
"In the park" means inside the boundaries
of the park. "At the park" is less specific and means at the general location
of the park (this could be inside the park, right outside the park or even near the park, depending on the context).
"I'm going to run at Central Park" refers to the area of the city where Central Park is located, in or near which you are going to run.
"I'm going to run in Central Park" specifies that the action of running will take place inside Central Park itself.
"To run a race / marathon" and "to run in
a race / marathon" are both correct, idiomatic English, and often mean the same thing. In some contexts, "I ran a race" carries the added nuance that you ran the course of the race in its entirety, whereas "I ran in a race" merely states that you took part in a race, regardless of whether you made it to the finish line. This is especially true when describing a past event.
More on the proper usage of "at" and "in" at:https://www.englishexperts.com.br/busca/ ... 34j84988j5