Estimate p-value for a d-dimensional sample If you have a set $X$ of one dimensional samples sampled from some distribution, then it is possible to compute an estimate of the p-value for a test sample $x_i$ as follows (which is easy to implement) :
$$p_{x_i} = \frac{|\{x_j \in X : x_j > x_i\}|}{|X|}$$
Now if you have d-dimensional samples (to simplify let's say 2 dimensions), is it possible to compute an estimate of the p-value with some similar method as above ?
 A: I am not sure what is your end goal (consider elaborating more in your question), but I am skeptical p-values will bring you there. Also, I think you slightly misunderstand what p-values are. Lets assume each observation is real number (but the same applies to any other domain). To speak about p-value, after observing $n$ datapoints, you need the vector of observed values $Y_{obs} \in \mathbb{R}^n$, a random variable representing a vector of data that would be observed under the null hypothesis $Y_{null}$  and a test statistic $T : \mathbb{R}^n \rightarrow \mathbb{R}$. Than p-value is defined as 
$p(Y_{rep}) = Prob[T(Y_{rep}) > T(Y_{null})]$ 
where the probability is with respect to the random variable $Y_{null}$ ($Y_{rep}$ is given). Further, p-value has to satisfy that if the null hypothesis is true ($Y_{rep}$ is drawn from the null distribution) than
$p(Y_{rep}) \sim Uniform(0,1)$  
where both $Y_{rep}$ and $Y_{null}$ are treated as random variables with the same null distribution.
So you need to say what is your test statistic and what is your null distribution. If I understand you correctly you want to determine if a single new observation comes from the same distribution as a set of observations you saw previously. I believe this is very seldom an interesting question. If you want to do it, the approach you outlined ignores the uncertainty you have in the already observed samples. To take this uncertainty into account (without any assumptions on the underlying distribution), your task translates to the Kolmogorov-Smirnov test. In higher dimensions this task becomes even more difficult to do and you need more than a single observation to say anything with any degree of certainty. This answer has some pointers to comparing samples from multivariate distributions without any assumptions.
