Answer: BeO is amphoteric, so it dissolves in both HCl and NaOH.
With aqueous HCl it acts as a base and forms beryllium chloride and water:
\[\mathrm{BeO + 2HCl \rightarrow BeCl_2 + H_2O}\]
With aqueous NaOH it acts as an acid and forms sodium beryllate:
\[\mathrm{BeO + 2NaOH + H_2O \rightarrow Na_2[Be(OH)_4]}\]
(This is often written in simpler form as \(\mathrm{BeO + 2NaOH \rightarrow Na_2BeO_2 + H_2O}\).)
Beryllium shows this amphoteric behaviour because the small, highly charged \(\mathrm{Be^{2+}}\) ion makes its oxide partly covalent. Oxides of the other group 2 elements (MgO, CaO, etc.) are basic only.