Yes and no (I've been using them in Terraform some time ago) - if you use them both in the same security group, you will have a conflict. You should:
• use "in-line" if you know all the rules when creating a security group
• use a "standalone Security Group Rule" when you are creating a security group in one place and can change some of the rules in another place
• never use them both in the same security group
In my opinion using a "standalone Security Group Rule" is more universal in most cases.