The sequence $\left(a_n \right)$ is defined by $a_1=1, \ a_2=2$ and
$$a_{n+2} = 2a_{n+1}-pa_n, \ \forall n \ge 1,$$ for some prime $p.$ Find all $p$ for which there exists $m$ such that $a_m=-3.$
To solve the problem, we need to find all prime numbers \( p \) for which there exists an integer \( m \) such that \( a_m = -3 \) in the sequence defined by \( a_1 = 1 \), \( a_2 = 2 \), and \( a_{n+2} = 2a_{n+1} - pa_n \) for all \( n \geq 1 \).

We will analyze the sequence modulo 3 and modulo \( p-4 \) to determine the possible values of \( p \).

1. **Case 1: \( p \equiv 0 \pmod{3} \)**

   If \( p \equiv 0 \pmod{3} \), then \( p = 3k \) for some integer \( k \). We need to check if \( a_n \) can be \(-3\) for some \( n \).

   - Since \( a_1 = 1 \) and \( a_2 = 2 \), we can compute the next few terms modulo 3:
     \[
     a_3 = 2a_2 - pa_1 = 2 \cdot 2 - 3k \cdot 1 = 4 - 3k \equiv 1 \pmod{3}
     \]
     \[
     a_4 = 2a_3 - pa_2 = 2 \cdot 1 - 3k \cdot 2 = 2 - 6k \equiv 2 \pmod{3}
     \]
     \[
     a_5 = 2a_4 - pa_3 = 2 \cdot 2 - 3k \cdot 1 = 4 - 3k \equiv 1 \pmod{3}
     \]
     \[
     a_6 = 2a_5 - pa_4 = 2 \cdot 1 - 3k \cdot 2 = 2 - 6k \equiv 2 \pmod{3}
     \]
   - We observe that the sequence \( a_n \mod 3 \) is periodic with period 2: \( (1, 2) \).

   - Since \( a_n \equiv 1 \) or \( 2 \pmod{3} \), \( a_n \) can never be \(-3 \pmod{3} \). Therefore, there is no \( m \) such that \( a_m = -3 \).

2. **Case 2: \( p \equiv -1 \pmod{3} \)**

   If \( p \equiv -1 \pmod{3} \), then \( p = 3k - 1 \) for some integer \( k \). We need to check if \( a_n \) can be \(-3\) for some \( n \).

   - We compute the sequence modulo 3:
     \[
     a_{n+2} \equiv 2a_{n+1} + a_n \pmod{3}
     \]
   - Starting with \( a_1 = 1 \) and \( a_2 = 2 \):
     \[
     a_3 \equiv 2a_2 + a_1 \equiv 2 \cdot 2 + 1 \equiv 4 + 1 \equiv 1 \pmod{3}
     \]
     \[
     a_4 \equiv 2a_3 + a_2 \equiv 2 \cdot 1 + 2 \equiv 2 + 2 \equiv 4 \equiv 1 \pmod{3}
     \]
     \[
     a_5 \equiv 2a_4 + a_3 \equiv 2 \cdot 1 + 1 \equiv 2 + 1 \equiv 3 \equiv 0 \pmod{3}
     \]
     \[
     a_6 \equiv 2a_5 + a_4 \equiv 2 \cdot 0 + 1 \equiv 1 \pmod{3}
     \]
   - The sequence \( a_n \mod 3 \) is periodic with period 6: \( (1, 2, 1, 1, 0, 1) \).

   - Since \( a_n \equiv 0 \pmod{3} \) only when \( n \equiv 5 \pmod{6} \), and \( a_n \equiv 1 \) or \( 2 \pmod{3} \) otherwise, \( a_n \) can never be \(-3 \pmod{3} \). Therefore, there is no \( m \) such that \( a_m = -3 \).

3. **Case 3: \( p \equiv 1 \pmod{3} \)**

   If \( p \equiv 1 \pmod{3} \), then \( p = 3k + 1 \) for some integer \( k \). We need to check if \( a_n \) can be \(-3\) for some \( n \).

   - We compute the sequence modulo 3:
     \[
     a_{n+2} \equiv 2a_{n+1} - a_n \pmod{3}
     \]
   - Starting with \( a_1 = 1 \) and \( a_2 = 2 \):
     \[
     a_3 \equiv 2a_2 - a_1 \equiv 2 \cdot 2 - 1 \equiv 4 - 1 \equiv 3 \equiv 0 \pmod{3}
     \]
     \[
     a_4 \equiv 2a_3 - a_2 \equiv 2 \cdot 0 - 2 \equiv -2 \equiv 1 \pmod{3}
     \]
     \[
     a_5 \equiv 2a_4 - a_3 \equiv 2 \cdot 1 - 0 \equiv 2 \pmod{3}
     \]
     \[
     a_6 \equiv 2a_5 - a_4 \equiv 2 \cdot 2 - 1 \equiv 4 - 1 \equiv 3 \equiv 0 \pmod{3}
     \]
   - The sequence \( a_n \mod 3 \) is periodic with period 3: \( (1, 2, 0) \).

   - Since \( a_n \equiv 0 \pmod{3} \) when \( n \equiv 0 \pmod{3} \), we need to check if \( a_n = -3 \) is possible.

   - We also need to consider the sequence modulo \( p-4 \):
     \[
     a_{n+2} \equiv 2a_{n+1} - 4a_n \pmod{p-4}
     \]
   - Using strong induction, we can show:
     \[
     a_n \equiv 2^{n-1} \pmod{p-4} \text{ if } n \equiv 1 \pmod{6} \text{ or } n \equiv 2 \pmod{6}
     \]
     \[
     a_n \equiv -2^{n-1} \pmod{p-4} \text{ if } n \equiv 4 \pmod{6} \text{ or } n \equiv 5 \pmod{6}
     \]
     \[
     a_n \equiv 0 \pmod{p-4} \text{ if } n \equiv 0 \pmod{3}
     \]
   - If there exists \( k \) such that \( a_k = -3 \), then \( p-4 \mid -3 \). Therefore, \( p-4 \) must be a divisor of 3, so \( p-4 = \pm 1 \) or \( \pm 3 \).

   - Since \( p \) is a prime number, the possible values are \( p = 1 + 4 = 5 \) or \( p = 7 \).

   - For \( p = 5 \):
     \[
     a_3 = 2a_2 - pa_1 = 2 \cdot 2 - 5 \cdot 1 = 4 - 5 = -1
     \]
     \[
     a_4 = 2a_3 - pa_2 = 2 \cdot (-1) - 5 \cdot 2 = -2 - 10 = -12
     \]
     - The sequence does not contain \(-3\).

   - For \( p = 7 \):
     \[
     a_3 = 2a_2 - pa_1 = 2 \cdot 2 - 7 \cdot 1 = 4 - 7 = -3
     \]
     - The sequence contains \(-3\) at \( a_3 \).

Therefore, the only prime \( p \) for which there exists \( m \) such that \( a_m = -3 \) is \( p = 7 \).

The final answer is \( \boxed{ p = 7 } \).