Is it allowed by codepen to embed it's pen in your website?: Yes it is, even codepen gives an option itself to embed a pen into your site

How to embed a codepen pen in your site:

Preview:

See the Pen Cheap AI Chess! by Jake Albaugh (@jakealbaugh) on CodePen.

To embed a codepen pen into your site, go to codepen.io and go to the pen which you want to embed in your site (Please use desktop). You will see an embed button at the left down corner. Click on it and change all the setting as per your need, copy the html code and paste it in your site. Done!