How to block TCP connections?
Is there a way to only block TCP connections for an app in Android?


Yes, if you have rooted phone:

~# iptables -I OUTPUT -m owner --uid-owner 10275 -p tcp -j DROP


This will block 100% outgoing TCP traffic of app having uid 10275. You can get UID from file /data/system/packages.list.

To block only UDP:

~# iptables -I OUTPUT -m owner --uid-owner 10275 -p udp -j DROP


Or to block both, don't mention any protocol.


  Can I block all incoming tcp connections?


INPUT doesn't work with owner module. Better is to just block outbound traffic, incoming is automatically blocked because traffic is initiated from client end i.e. your phone.
See this answer for details.

Also you can use iptables based firewall app like AFWall+ or VPN based firewall like Netguard to block outbound traffic.