Yes, but any contributions above this will normally be taxed.
You may be able to avoid this by carrying forward any unused annual allowance from previous tax years. There are some rules around this, you can only go back three years, you must have been a registered member of the scheme in the tax year you are carrying forward from and you can only carry forward up to the £40,000 limit in each tax year.
Don't forget this includes any contributions from an employer and increases in value of any other pension savings you may have.
If you'd like to find out more about this, click here to check the latest information on the HM Revenue & Customs website and seek advice from a tax specialist or financial adviser before investing - to ensure you don't incur tax charges you weren't expecting.