Question: Is there some provably secure hash function to prime numbers?  

Say, a function $H: \{0, 1\}^\* \rightarrow \{e: e \in \{0, 1\}^\lambda \land e$ is prime$\}$  

I'm asking because there are some constructions to be used only on prime numbers (for example [CL02](http://groups.csail.mit.edu/cis/pubs/lysyanskaya/cl02a.pdf) Strong-RSA Dynamic Accumulators).

Answer: 
You could use the hash value as seed for a deterministic CSPRNG and then use a prime number generator also used for RSA key pair generation. Note that the size of the prime number must be relatively high (1536 bits for 128 bits of security, e.g. for an RSA key of 3072 bits).

[The usual caveats of deterministic RSA key pair generation apply](https://crypto.stackexchange.com/q/24514/1172). For instance, the algorithms must remain the same, otherwise a different prime value is calculated for the same hash value.

Generally the method of generating the prime value is available separately in math or crypto libraries that come with the runtime. For instance, Java has the `BigInteger(int bitLength, int certainty, Random rnd)` constructor.

Beware that the time it takes to find a prime is unknown in advance. The generation may take a long time (and in the case of Java may also take a ridiculous number of bytes from the DRBG - just tested this).
**This answer updated since new foundings**

Let $H$ be a (provably) secure hash function $H:\{0,1\}^\* \rightarrow \{2^h\}$, where $h$ is the output size of the $H$. 

Now, using this $H$, we will construct a (provably) secure hash function to primes $H'$ as follows;

* let $P$ be Oracle of Mathematica `Prime[n]` function.
* given message $m$ output;

$$H'(m) := \text{Prime}[H(m)]$$

Since this is just a bijection, $H'$ is a (provably) secure hash function.

**Note:** I looked for the theory of this `Prime[n]` function but couldn't. The Mathematica find the $n-th$ prime very quickly. [Try](https://www.wolframalpha.com/input/?i=Prime%5B2%5E512%5D) $\text{Prime}[2^{512}]$ at WolframAlpha.