They are both annual herbs that do not survive freezing temperatures, so planting them side by side will not harm them.
Parsley and basil are two popular herb plants. However, there is one thing that might stop you from planting them together - they need different growing conditions. Parsley needs lots of sun and a rich compost while basil prefers less sun and a lighter compost such as regular potting soil or garden soil.