How can I know in order confirmation email if the order is a subscription order or not?

In order confirmation emails in Shopify, you can know if the order has a subscription product in it simply by using the Liquid code to loop through items in the order and checking if any of the items has a selling plan allocation property on it. 

You can show also the selling plan in there if you edit the notification template in Shopify admin > Settings > Notifications > Order confirmation.
Basically, to show the selling plan name, you just have to add the following line on the correct location:

{% if line.selling_plan_allocation %}
    <span class="order-list__item-variant">{{ line.selling_plan_allocation.selling_plan.name }}</span><br/>
{% endif %}

Newer Shopify stores have this in the email template by default, but if you don't have it in there, then we recommend that you hire a Shopify Expert and ask them to add this code in there for you.
And you can use the same logic to figure out if the order contains a subscription product in it.