Computing basis of a field extension
We can consider the extension of K over F as a vector space over F . Evidently, this field has a basis and it is given by $\{1,\theta,…,\theta^{n−1}\}$ , where $\theta\equiv x\pmod{p(x)}\in K$.
There are in general many different bases for $K$ as a vector space over $F$, and "the" basis you give above is in general not unique. The condition $\theta\equiv x\pmod{p(x)}$ is equivalent to $x-\theta$ dividing $p(x)$, i.e. to $\theta$ being a root of $p(x)$. Choosing different roots in general yields different bases for $K$ over $F$.
..., but how exactly can we use this definition to deduce that $\theta=i$ when considering $\Bbb{R}[x]/(x^2 +1)$?
We cannot deduce this because $i\in\Bbb{C}$ is not an element of $\Bbb{R}[x]/(x^2+1)$. The two fields are isomorpic, but there is no canonical isomorphism between them. In fact there are precisely two isomorphisms (of fields) given by mapping $x$ to $i$ or mapping $x$ to $-i$, corresponding to different choices of roots of $x^2+1$ in $\Bbb{C}$. Alterrnatively, there are preciely two field automorphisms of $\Bbb{C}$ that are the identity on $\Bbb{R}$; these are the identity and complex conjugation.
Or, for that matter, $\mathbb{Q}[x]/(x^{3} - 2)$?
This field can be embedded in $\Bbb{C}$, and even in $\Bbb{R}$. For the latter we must map the class of $x$ in $\Bbb{Q}[x]/(x^3-2)$ to $\sqrt[3]{2}\in\Bbb{R}$ so the embedding is unique and we may identify $\Bbb{Q}[x]/(x^3-2)$ with $\Bbb{Q}(\sqrt[3]{2})\subset\Bbb{R}$. Indeed $x^3-2$ has a unique root in $\Bbb{R}$. However, there are three distinct embeddings into $\Bbb{C}$ corresponding to three distinct roots of $x^3-2$ in $\Bbb{C}$, so again we cannot identify the class of $x$ in $\Bbb{Q}[x]/(x^3-2)$ with an element of $\Bbb{C}$ canonically.
Let $\theta$ be the coset of $x$ in $K = \mathbf{R}[x]/\langle x^2+1\rangle$. Then we have $\theta^2 + 1 = x^2+1$ in $\mathbf{R}[x]$, so $\theta^2+1 = 0$ in $K$. So $\theta$ is an element of $K$ such that $\theta^2 = -1$, this is exactly what we call "$i$".
Given a field $K$, the process of taking the quotient ring $K[x]/\langle p(x)\rangle$ for an irreducible polynomial $p(x)$ is just a nice way to construct an extension field of $K$ in which $p(x)$ has a root, that root being the coset of $x$.
To compute the basis a field extension:
1) 1 is in the basis
2) find the roots of the irreducible polynomial, and then take all possible multiples of these roots with each other, and possible products of each root with itself, and then you get the basis.
Basically, you just want to account for all possible linear combinations now that you have extended the field.