A subset $X$ in the $d$-dimensional Euclidean space is called a $k$-distance set if there are exactly $k$ distinct distances between two distinct points in $X$ and a subset $X$ is called a locally $k$-distance set if for any point $x$ in $X$, there are at most $k$ distinct distances between $x$ and other points in $X$. Delsarte, Goethals, and Seidel gave the Fisher type upper bound for the cardinalities of $k$-distance sets on a sphere in 1977. In the same way, we are able to give the same bound for locally $k$-distance sets on a sphere. In the first part of this paper, we prove that if $X$ is a locally $k$-distance set attaining the Fisher type upper bound, then determining a weight function $w$, $(X,w)$ is a tight weighted spherical $2k$-design. This result implies that locally $k$-distance sets attaining the Fisher type upper bound are $k$-distance sets. In the second part, we give a new absolute bound for the cardinalities of $k$-distance sets on a sphere. This upper bound is useful for $k$-distance sets for which the linear programming bound is not applicable. In the third part, we discuss about locally two-distance sets in Euclidean spaces. We give an upper bound for the cardinalities of locally two-distance sets in Euclidean spaces. Moreover, we prove that the existence of a spherical two-distance set in $(d-1)$-space which attains the Fisher type upper bound is equivalent to the existence of a locally two-distance set but not a two-distance set in $d$-space with more than $d(d+1)/2$ points. We also classify optimal (largest possible) locally two-distance sets for dimensions less than eight. In addition, we determine the maximum cardinalities of locally two-distance sets on a sphere for dimensions less than forty.