The European Union and NATO should open their doors to all countries who want to join, Poland's President Andrzej Duda says.