Yes, a CV can be 2 pages. But your CV shouldn’t be longer than 2 pages unless you’re a senior professional or preparing an academic CV (which has no page limit).
If you’ve recently graduated from university or are writing a school leaver CV and can fit all your relevant experience and skills onto a one-page CV without it looking cramped, then make it one page. Otherwise, a two-page CV is fine.